bool WRibbonHook( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam ) { bool ret; WMenuEditInfo *einfo; _wtouch( hwnd ); _wtouch( wParam ); _wtouch( lParam ); einfo = WGetCurrentEditInfo(); if( einfo == NULL || einfo->ribbon == NULL ) { return( false ); } ret = false; switch( msg ) { case WM_DESTROY: WCloseToolBar( einfo->ribbon ); einfo->ribbon = NULL; break; } return( ret ); }
BOOL WRibbonHook ( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam ) { Bool ret; WAccelEditInfo *einfo; _wtouch(hwnd); _wtouch(wParam); _wtouch(lParam); einfo = WGetCurrentEditInfo (); if ( !einfo || !einfo->ribbon ) { return( FALSE ); } ret = FALSE; switch ( msg ) { case WM_DESTROY: WCloseToolBar ( einfo->ribbon ); einfo->ribbon = NULL; break; } return ( ret ); }
WINEXPORT void CALLBACK WMenuHelpOnHelpRoutine( void ) { WMenuEditInfo *einfo; einfo = WGetCurrentEditInfo(); if( einfo != NULL ) { WWinHelp( einfo->win, "winhelp.hlp", HELP_HELPONHELP, 0 ); } }
Bool WSetStatusText( WStatBar *wsb, const char *s1, const char *s2 ) { int len; int pos; WAccelEditInfo *einfo; if( wsb == NULL ) { einfo = WGetCurrentEditInfo(); if( einfo != NULL ) { wsb = einfo->wsb; if( wsb == NULL ) { return( FALSE ); } } else { return( FALSE ); } } if( wsb->win == (HWND)NULL ) { return( TRUE ); } if( s1 != NULL ) { len = min( strlen( s1 ), MAX_STATUS_TEXT ); if( len != 0 ) { memcpy( wsb->text, s1, len ); pos = len; } else { wsb->text[0] = ' '; pos = 1; } } else { pos = 0; } if( s2 != NULL ) { wsb->text[pos++] = STATUS_ESC_CHAR; wsb->text[pos++] = STATUS_NEXT_BLOCK; len = min( strlen( s2 ), MAX_STATUS_TEXT ); if( len != 0 ) { memcpy( wsb->text + pos, s2, len ); wsb->text[pos + len] = '\0'; } else { wsb->text[pos++] = ' '; wsb->text[pos] = '\0'; } } else { wsb->text[pos++] = '\0'; } if( s1 != NULL || s2 != NULL ) { return( WDisplayStatusText( wsb ) ); } return( TRUE ); }
WINEXPORT void CALLBACK WMenuHelpSearchRoutine( void ) { WMenuEditInfo *einfo; einfo = WGetCurrentEditInfo(); if( einfo != NULL ) { if( !WHtmlHelp( einfo->win, "resmnu.chm", HELP_PARTIALKEY, (HELP_DATA)"" ) ) { WWinHelp( einfo->win, "resmnu.hlp", HELP_PARTIALKEY, (HELP_DATA)"" ); } } }
WINEXPORT void CALLBACK WMenuHelpRoutine( void ) { WMenuEditInfo *einfo; einfo = WGetCurrentEditInfo(); if( einfo != NULL ) { if( !WHtmlHelp( einfo->win, "resmnu.chm", HELP_CONTENTS, 0 ) ) { WWinHelp( einfo->win, "resmnu.hlp", HELP_CONTENTS, 0 ); } } }
void CALLBACK WAccHelpSearchRoutine( void ) { WAccelEditInfo *einfo; einfo = WGetCurrentEditInfo(); if( einfo != NULL ) { if( !WHtmlHelp( einfo->win, "resacc.chm", HELP_PARTIALKEY, (DWORD)"" ) ) { WWinHelp( einfo->win, "resacc.hlp", HELP_PARTIALKEY, (DWORD)"" ); } } }
void CALLBACK WAccHelpRoutine( void ) { WAccelEditInfo *einfo; einfo = WGetCurrentEditInfo(); if( einfo != NULL ) { if( !WHtmlHelp( einfo->win, "resacc.chm", HELP_CONTENTS, 0 ) ) { WWinHelp( einfo->win, "resacc.hlp", HELP_CONTENTS, 0 ); } } }
HMENU WGetMenuHandle( WMenuEditInfo *einfo ) { if( einfo == NULL ) { einfo = WGetCurrentEditInfo(); } if( einfo != NULL && einfo->win != NULL ) { return( GetMenu( einfo->win ) ); } return( NULL ); }
void WResizeWindows( WMenuEditInfo *einfo ) { RECT rect; if( einfo == NULL ) { einfo = WGetCurrentEditInfo(); } if( einfo != NULL && einfo->win != NULL ) { GetClientRect( einfo->win, &rect ); WResizeMenuEditWindow( einfo, &rect ); WResizeStatusWindows( einfo->wsb, &rect ); WResizeRibbon( einfo, &rect ); } }
void WDisplayHint( WStatBar *wsb, int id ) { WHintItem *hint; WMenuEditInfo *einfo; if( id == IDM_MENU_INSERTTOGGLE ) { einfo = WGetCurrentEditInfo(); if( einfo != NULL ) { if( einfo->insert_before ) { id = IDM_MENU_INSERTBEFORE; } else { id = IDM_MENU_INSERTAFTER; } } } hint = WGetHintItem( id ); if( hint != NULL ) { WSetStatusByID( wsb, -1, hint->hint ); } }