| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147 |
- /*
- ** Command & Conquer Renegade(tm)
- ** Copyright 2025 Electronic Arts Inc.
- **
- ** This program is free software: you can redistribute it and/or modify
- ** it under the terms of the GNU General Public License as published by
- ** the Free Software Foundation, either version 3 of the License, or
- ** (at your option) any later version.
- **
- ** This program is distributed in the hope that it will be useful,
- ** but WITHOUT ANY WARRANTY; without even the implied warranty of
- ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- ** GNU General Public License for more details.
- **
- ** You should have received a copy of the GNU General Public License
- ** along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
- /***********************************************************************************************
- *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
- ***********************************************************************************************
- * *
- * Project Name : LevelEdit *
- * *
- * $Archive:: /Commando/Code/Tools/LevelEdit/DialogToolbar.cpp $*
- * *
- * Author:: Patrick Smith *
- * *
- * $Modtime:: 2/17/99 2:02p $*
- * *
- * $Revision:: 1 $*
- * *
- *---------------------------------------------------------------------------------------------*
- * Functions: *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
- #include "StdAfx.H"
- #include "DialogToolbar.H"
- #include "AfxPriv.H"
- BEGIN_MESSAGE_MAP(DialogToolbarClass, CToolBar)
- //{{AFX_MSG_MAP(DialogToolbarClass)
- ON_MESSAGE(WM_IDLEUPDATECMDUI, OnIdleUpdateCmdUI)
- ON_MESSAGE_VOID(WM_INITIALUPDATE, OnInitialUpdate)
- ON_NOTIFY_EX( TTN_NEEDTEXT, 0, OnNeedToolTipText)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- DialogToolbarClass::DialogToolbarClass (void)
- : CToolBar ()
- {
- //{{AFX_DATA_INIT(DialogToolbarClass)
- // NOTE: the ClassWizard will add member initialization here
- //}}AFX_DATA_INIT
- return ;
- }
- #ifdef _DEBUG
- void DialogToolbarClass::AssertValid() const
- {
- CToolBar::AssertValid();
- }
- void DialogToolbarClass::Dump(CDumpContext& dc) const
- {
- CToolBar::Dump(dc);
- }
- #endif //_DEBUG
- ///////////////////////////////////////////////////////////////////
- //
- // Enable_Button
- //
- void
- DialogToolbarClass::Enable_Button
- (
- int id,
- bool benable
- )
- {
- // Get the button's style (we enable by using a style bit)
- int index = CommandToIndex (id);
- UINT style = GetButtonStyle (index) & (~TBBS_DISABLED);
-
- // If we are disabling the button, set the
- // disabled style bit.
- if (benable == false) {
- style |= TBBS_DISABLED;
- style &= ~TBBS_PRESSED;
- }
- // If the button isn't a separator, then modify its style
- if (!(style & TBBS_SEPARATOR)) {
- SetButtonStyle (index, style);
- }
- return ;
- }
- ///////////////////////////////////////////////////////////////////
- //
- // OnIdleUpdateCmdUI
- //
- LRESULT
- DialogToolbarClass::OnIdleUpdateCmdUI (WPARAM, LPARAM)
- {
- return 0L;
- }
- ///////////////////////////////////////////////////////////////////
- //
- // OnInitialUpdate
- //
- void
- DialogToolbarClass::OnInitialUpdate (void)
- {
- return ;
- }
- ///////////////////////////////////////////////////////////////////
- //
- // OnNotify
- //
- BOOL
- DialogToolbarClass::OnNeedToolTipText
- (
- UINT id,
- NMHDR *pTTTStruct,
- LRESULT *pResult
- )
- {
- if (pTTTStruct->code == TTN_NEEDTEXTA) {
-
- TOOLTIPTEXTA *ptooltip_info = (TOOLTIPTEXTA*)pTTTStruct;
- ::lstrcpy (ptooltip_info->szText, "test");
- }
- (*pResult) = 0L;
- return TRUE;
- }
|