void TellWinHandle( void ) { if( !ToldWinHandle ) { TrapTellHWND( GUIGetSysHandle( WndGui( WndMain ) ) ); ToldWinHandle = TRUE; } }
void TellWinHandle( void ) { if( !ToldWinHandle ) { TellHandles( GUIGetHAB(), GUIGetSysHandle( WndGui( WndMain ) ) ); ToldWinHandle = TRUE; } }
void ToggleHardMode( void ) { TrapForceHardMode = !TrapForceHardMode; #ifdef __GUI__ TrapSetHardMode( TrapForceHardMode ); GUICheckMenuItem( WndGui( WndMain ), MENU_MAIN_WINDOW_HARD_MODE, TrapForceHardMode ); #endif GUISetModalDlgs( TrapForceHardMode || TrapHardModeRequired ); }
STATIC bool sampleProcBotStatus( a_window *wnd, int row, int piece, wnd_line_piece *line ) /*******************************************************************/ { gui_point start; gui_point end; gui_ord vertical_x; gui_ord max_x; gui_ord max_y; gui_ord client_height; gui_ord client_width; gui_ord cross_y; row=row; piece=piece; line=line; if( piece > PIECE_DRAW_LINE ) return( false ); if( piece == PIECE_MOUSE_CATCHER ) { line->indent = 0; line->tabstop = false; line->attr = WPA_PLAIN; line->text = LIT( Empty_Str ); line->extent = WndWidth( wnd ); return( true ); } max_y = WndMaxCharY( wnd ); max_x = WndAvgCharX( wnd ); vertical_x = SEPARATOR_POINT + max_x / 2; client_height = WPGetClientHeight( wnd ); client_width = WPGetClientWidth( wnd ); cross_y = max_y * STATUS_ROW + max_y/4; start.x = 0; end.x = client_width; start.y = cross_y; end.y = start.y; GUIDrawLine( WndGui( wnd ), &start, &end, GUI_PEN_SOLID, 0, WPA_PLAIN ); start.x = vertical_x; end.x = vertical_x; start.y = cross_y; end.y = client_height; GUIDrawLine( WndGui( wnd ), &start, &end, GUI_PEN_SOLID, 0, WPA_PLAIN ); return( true ); }
void DUIShow( void ) { WndDebug(); WndShowAll(); WndShowWndMain(); WndMainEventProc( WndGui( WndMain ), GUI_NO_EVENT, NULL ); if( _IsOff( SW_HAVE_TASK ) && _IsOff( SW_PROC_ALREADY_STARTED ) ) { DlgNewProg(); } }
ToggleHardMode( void ) { ForceHardMode = !ForceHardMode; #ifdef __GUI__ SetHardMode( ForceHardMode ); GUICheckMenuItem( WndGui( WndMain ), MENU_MAIN_WINDOW_HARD_MODE, ForceHardMode ); #endif GUISetModalDlgs( ForceHardMode || HardModeRequired ); }
bool DebugScreen( void ) { if( ScreenState == DEBUG_SCREEN ) return( FALSE ); if( WndMain ) { ScreenState = DEBUG_SCREEN; GUISetModalDlgs( ForceHardMode || HardModeRequired ); SetFocus( GUIGetSysHandle( WndGui( WndMain ) ) ); } return( FALSE ); }
bool DebugScreen( void ) { HWND hwnd; HWND fore; if( ScreenState == DEBUG_SCREEN ) return( FALSE ); if( _IsOn( SW_POWERBUILDER ) ) return( FALSE ); if( WndMain ) { ScreenState = DEBUG_SCREEN; hwnd = GUIGetSysHandle( WndGui( WndMain ) ); fore = GetForegroundWindow(); if( fore != hwnd ) { HwndFore = fore; } if( GUIIsMinimized( WndGui( WndMain ) ) ) GUIRestoreWindow( WndGui( WndMain ) ); if( IsWindow( hwnd ) ) SetForegroundWindow( hwnd ); if( _IsOn( SW_POWERBUILDER ) ) { WndRestoreWindow( WndMain ); } } return( FALSE ); }
unsigned OnAnotherThreadAccess( trap_elen in_num, in_mx_entry_p in_mx, trap_elen out_num, mx_entry_p out_mx ) { unsigned result; if( !ToldWinHandle || IsTrapFilePumpingMessageQueue() ) { return( TrapAccess( in_num, in_mx, out_num, out_mx ) ); } else { DosSemClear( &PumpMessageSem ); result = TrapAccess( in_num, in_mx, out_num, out_mx ); WinPostMsg( GUIGetSysHandle( WndGui( WndMain ) ), WM_QUIT, 0, 0 ); DosSemWait( &PumpMessageDoneSem, SEM_INDEFINITE_WAIT ); DosSemSet( &PumpMessageDoneSem ); return( result ); } }
unsigned OnAnotherThreadSimpAccess( unsigned in_len, in_data_p in_data, unsigned out_len, out_data_p out_data ) { unsigned result; if( !ToldWinHandle || IsTrapFilePumpingMessageQueue() ) { return( TrapSimpAccess( in_len, in_data, out_len, out_data ) ); } else { DosSemClear( &PumpMessageSem ); result = TrapSimpAccess( in_len, in_data, out_len, out_data ); WinPostMsg( GUIGetSysHandle( WndGui( WndMain ) ), WM_QUIT, 0, 0 ); DosSemWait( &PumpMessageDoneSem, SEM_INDEFINITE_WAIT ); DosSemSet( &PumpMessageDoneSem ); return( result ); } }
void WPProcHelp( gui_help_actions action ) /****************************************/ { char help_name[_MAX_PATH2]; #if !defined( __WINDOWS__ ) && !defined( __NT__ ) && !defined( __OS2_PM__ ) char * filename; #endif #ifdef __NT__ if( GUIShowHtmlHelp( helpHandle, WndGui( WndMain ), action, HTMLHELPNAME, "" ) ) { return; } #endif #if defined( __WINDOWS__ ) || defined( __NT__ ) || defined( __OS2_PM__ ) strcpy( help_name, HELPNAME ); #else filename = FindFile( help_name, "wprof.ihp", HelpPathList ); if( filename == NULL ) { ErrorMsg( LIT( Unable_To_Open_Help ), "wprof.ihp" ); return; } #endif GUIShowHelp( helpHandle, WndGui( WndMain ), action, help_name, "" ); }
a_window W6Open( void ) { wnd_create_struct info; a_window wnd; WndInitCreateStruct( &info ); info.info = &W6Info; info.style |= GUI_INIT_INVISIBLE | GUI_POPUP; wnd = WndCreateWithStruct( &info ); WndSetFontInfo( wnd, "-13 0 0 0 700 0 0 0 0 1 2 1 18 \"MS Serif\"" ); WndForcePaint( wnd ); WndShrinkToMouse( wnd, &W6Metrics ); GUIShowWindow( WndGui( wnd ) ); return( wnd ); }
unsigned OnAnotherThread( unsigned(*rtn)(unsigned,void *,unsigned,void *), unsigned in_len, void *in, unsigned out_len, void *out ) { unsigned result; if( !ToldWinHandle || IsTrapFilePumpingMessageQueue() ) { return( rtn( in_len, in, out_len, out ) ); } else { DosSemClear( &PumpMessageSem ); result = rtn( in_len, in, out_len, out ); WinPostMsg( GUIGetSysHandle( WndGui( WndMain ) ), WM_QUIT, 0, 0 ); DosSemWait( &PumpMessageDoneSem, SEM_INDEFINITE_WAIT ); DosSemSet( &PumpMessageDoneSem ); return( result ); } }
unsigned OnAnotherThread( unsigned(*rtn)(unsigned,void *,unsigned,void *), unsigned in_len, void *in, unsigned out_len, void *out ) { unsigned result; ULONG ulCount; if( !ToldWinHandle || IsTrapFilePumpingMessageQueue() ) { return rtn( in_len, in, out_len, out ); } else { DosPostEventSem( PumpMessageSem ); result = rtn( in_len, in, out_len, out ); WinPostMsg( GUIGetSysHandle( WndGui( WndMain ) ), WM_QUIT, 0, 0 ); DosWaitEventSem( PumpMessageDoneSem, SEM_INDEFINITE_WAIT ); DosResetEventSem( PumpMessageDoneSem, &ulCount ); return result; } }
unsigned OnAnotherThreadSimpAccess( unsigned in_len, in_data_p in_data, unsigned out_len, out_data_p out_data ) { unsigned result; ULONG ulCount; if( !ToldWinHandle || IsTrapFilePumpingMessageQueue() ) { return( TrapSimpAccess( in_len, in_data, out_len, out_data ) ); } else { DosPostEventSem( PumpMessageSem ); result = TrapSimpAccess( in_len, in_data, out_len, out_data ); WinPostMsg( GUIGetSysHandle( WndGui( WndMain ) ), WM_QUIT, 0, 0 ); DosWaitEventSem( PumpMessageDoneSem, SEM_INDEFINITE_WAIT ); DosResetEventSem( PumpMessageDoneSem, &ulCount ); return result; } }
static void TimeIt( void ) { char buff[80]; size_t len; long iters; a_window wnd; gui_text_metrics dummy; wnd = WndFindActive(); if( wnd == NULL ) return; buff[0]='\0'; DlgNew( "Enter Iterations", buff, 80 ); if( buff[0] == '\0' ) return; iters = strtol( buff, NULL, 10 ); strcpy( buff, "This is just some text" ); len = strlen( buff ); while( --iters >= 0 ) { // GUIDrawText( WndGui( wnd ), buff, len, 0, 0, WndPlainAttr ); GUIGetTextMetrics( WndGui( wnd ), &dummy ); // WndExtentX( wnd, "This is just some text" ); } }
void TellWinHandle() { if( _IsOn( SW_POWERBUILDER ) ) return; TellHWND( GUIGetSysHandle( WndGui( WndMain ) ) ); }
void WPFiniHelp( void ) /*********************/ { GUIHelpFini( helpHandle, WndGui( WndMain ), HELPNAME ); }
void TellWinHandle( void ) { if( !ToldWinHandle && TrapTellHandles( GUIGetHAB(), GUIGetSysHandle( WndGui( WndMain ) ) ) ) { ToldWinHandle = true; } }
void WPInitHelp( void ) /*********************/ { helpHandle = GUIHelpInit( WndGui( WndMain ), HELPNAME, "Open Watcom Profiler Help" ); }