OVL_EXTERN bool WndSetEvent( gui_window * gui, gui_event gui_ev, void * param ) { unsigned id; dlg_window_set *wndset; wndset = GUIGetExtra( gui ); switch( gui_ev ) { case GUI_INIT_DIALOG: GUISetFocus( gui, CTL_WIND_ASM_SOURCE ); SetDlgStatus( gui ); return( TRUE ); case GUI_CONTROL_CLICKED : GUI_GETID( param, id ); switch( id ) { case CTL_WIND_OK: wndset->cancel = FALSE; GetDlgStatus( gui ); GUICloseDialog( gui ); break; case CTL_WIND_CANCEL: wndset->cancel = TRUE; GUICloseDialog( gui ); break; case CTL_WIND_DEFAULTS: SetDlgStatus( gui ); break; } return( TRUE ); } return( FALSE ); }
OVL_EXTERN bool OptSetEvent( gui_window * gui, gui_event gui_ev, void * param ) { unsigned id; dlg_window_set *optset; optset = GUIGetExtra( gui ); switch( gui_ev ) { case GUI_INIT_DIALOG: SetDlgStatus( gui ); GUISetFocus( gui, CTL_OPT_RADIX ); return( TRUE ); case GUI_CONTROL_CLICKED : GUI_GETID( param, id ); switch( id ) { case CTL_OPT_OK: optset->cancel = FALSE; GetDlgStatus( gui ); GUICloseDialog( gui ); break; case CTL_OPT_CANCEL: optset->cancel = TRUE; GUICloseDialog( gui ); break; case CTL_OPT_DEFAULTS: SetDlgStatus( gui ); break; } return( TRUE ); } return( FALSE ); }
bool DisplayMessage( gui_window *gui, gui_event gui_ev, void *param ) { gui_message_return *ret; unsigned id; ret = GUIGetExtra( gui ); switch( gui_ev ) { case GUI_CONTROL_CLICKED : GUI_GETID( param, id ); switch( id ) { case GUI_RET_ABORT : case GUI_RET_CANCEL : case GUI_RET_IGNORE : case GUI_RET_NO : case GUI_RET_OK : case GUI_RET_RETRY : case GUI_RET_YES : *ret = id; GUICloseDialog( gui ); return( TRUE ); break; default : break; } default : break; } return( TRUE ); }
OVL_EXTERN bool AsyncEvent( gui_window *gui, gui_event gui_ev, void *param ) { gui_ctl_id id; switch( gui_ev ) { case GUI_INIT_DIALOG: dlg.cond = 0; GUISetFocus( gui, CTL_ASYNC_STOP ); AsyncWnd = gui; return( TRUE ); case GUI_CONTROL_CLICKED : GUI_GETID( param, id ); switch( id ) { case CTL_ASYNC_STOP: AsyncWnd = 0; dlg.cond = StopAsync(); GUICloseDialog( gui ); return( TRUE ); } return( FALSE ); case GUI_DESTROY: AsyncWnd = 0; return( TRUE ); } return( FALSE ); }
OVL_EXTERN bool VarGUIEventProc( gui_window *gui, gui_event gui_ev, void *param ) { gui_ctl_id id; dlg_var_expand *varx; varx = GUIGetExtra( gui ); switch( gui_ev ) { case GUI_INIT_DIALOG: SetDlgStatus( varx, gui ); GUISetFocus( gui, CTL_VARX_START ); return( true ); case GUI_CONTROL_CLICKED : GUI_GETID( param, id ); switch( id ) { case CTL_VARX_OK: if( GetDlgStatus( varx, gui ) ) { varx->cancel = false; GUICloseDialog( gui ); } return( true ); case CTL_VARX_CANCEL: varx->cancel = true; GUICloseDialog( gui ); return( true ); case CTL_VARX_DEFAULTS: SetDlgStatus( varx, gui ); return( true ); } break; } return( false ); }
STATIC bool progEvent( gui_window * gui, gui_event gui_ev, void * param ) /***********************************************************************/ { unsigned id; switch( gui_ev ) { case GUI_INIT_DIALOG: setDlgValues( gui ); GUISetFocus( gui, CTL_NAME ); return( P_TRUE ); case GUI_CONTROL_CLICKED : GUI_GETID( param, id ); switch( id ) { case CTL_BROWSE: dlgBrowseFmtFile( gui ); return( P_TRUE ); case CTL_OK: getDlgValues( gui ); if( dlgOpenFmtFile() ) { GUICloseDialog( gui ); } return( P_TRUE ); case CTL_DEFAULTS: setDlgDefaults( gui ); return( P_TRUE ); case CTL_CANCEL: GUICloseDialog( gui ); return( P_TRUE ); } return( P_FALSE ); case GUI_DESTROY: return( P_TRUE ); } return( P_FALSE ); }
extern bool CmdEvent( gui_window * gui, gui_event gui_ev, void * param ) { gui_ctl_id id; char *text; char *cmd; int i; cmd = GUIGetExtra( gui ); switch( gui_ev ) { case GUI_INIT_DIALOG: GUISetText( gui, CTL_CMD_EDIT, "Hi Lisa!" ); GUISetFocus( gui, CTL_CMD_EDIT ); GUIClearList( gui, CTL_CMD_HISTORY ); for( i = 0; i < ArraySize( Stuff ); ++i ) { GUIAddText( gui, CTL_CMD_HISTORY, Stuff[i] ); } GUISetCurrSelect( gui, CTL_CMD_HISTORY, 1 ); return( TRUE ); case GUI_KEY_CONTROL: GUISetCurrSelect( gui, CTL_CMD_HISTORY, 2 ); cmd = GUIGetText( gui, CTL_CMD_HISTORY ); GUISetText( gui, CTL_CMD_EDIT, cmd ); GUISelectAll( gui, CTL_CMD_EDIT, TRUE ); GUIMemFree( cmd ); return( TRUE ); case GUI_CONTROL_DCLICKED: case GUI_CONTROL_CLICKED: GUI_GETID( param, id ); switch( id ) { case CTL_CMD_HISTORY: text = GUIGetText( gui, CTL_CMD_HISTORY ); GUISetText( gui, CTL_CMD_EDIT, text ); GUIMemFree( text ); if( gui_ev == GUI_CONTROL_CLICKED ) return( TRUE ); /* fall through */ case CTL_CMD_OK: text = GUIGetText( gui, CTL_CMD_EDIT ); if( text != NULL ) DoCmd( text ); GUIMemFree( text ); break; case CTL_CMD_CHECK: return( FALSE ); } GUICloseDialog( gui ); /* fall through */ case GUI_DESTROY: WndFree( cmd ); return( TRUE ); default: return( FALSE ); } }
bool ToolbarCallBack( gui_window *wnd, gui_event gui_ev, void *param ) { gui_ctl_id id; switch( gui_ev ) { case GUI_INIT_WINDOW : GUIEVENTWND( wnd->parent, GUI_TOOLBAR_FLOATING, NULL ); return( true ); case GUI_KEYDOWN : case GUI_KEYUP : GUIEVENTWND( wnd->parent, gui_ev, param ); break; case GUI_CLICKED : GUI_GETID( param, id ); if( id == FIX_TOOLBAR ) { FixToolbar( wnd ); } break; case GUI_CONTROL_CLICKED : GUI_GETID( param, id ); id = EV2ID( id ); GUIEVENTWND( wnd->parent, GUI_CLICKED, &id ); break; case GUI_LBUTTONDBLCLK : FixToolbar( wnd ); break; case GUI_DESTROY : /* didn't get close first */ if( wnd->parent->tbinfo->floattoolbar != NULL ) { wnd->parent->tbinfo->floattoolbar = NULL; } GUICloseToolBar( wnd->parent ); break; case GUI_CLOSE : wnd->parent->tbinfo->floattoolbar = NULL; break; default : break; } return( true ); }
extern bool SrchEvent( gui_window * gui, gui_event event, void * param ) { gui_ctl_id id; dlg_search *dlg; dlg = GUIGetExtra( gui ); switch( event ) { case GUI_INIT_DIALOG: SetDlgStatus( gui, dlg ); GUISetFocus( gui, CTL_SRCH_EDIT ); break; case GUI_KEY_CONTROL: return( DlgHistoryKey( gui, param, CTL_SRCH_EDIT, CTL_SRCH_LIST ) ); case GUI_CONTROL_DCLICKED: case GUI_CONTROL_CLICKED: GUI_GETID( param, id ); switch( id ) { case CTL_SRCH_LIST: DlgClickHistory( gui, CTL_SRCH_EDIT, CTL_SRCH_LIST ); if( event == GUI_CONTROL_CLICKED ) return( true ); /* fall through */ case CTL_SRCH_NEXT: dlg->direction = 1; GetDlgStatus( gui, dlg ); GUICloseDialog( gui ); break; case CTL_SRCH_EDIT_RX: ResDlgOpen( &RXEvent, NULL, GUI_MAKEINTRESOURCE( DIALOG_RX ) ); break; case CTL_SRCH_PREV: dlg->direction = -1; GetDlgStatus( gui, dlg ); GUICloseDialog( gui ); break; case CTL_SRCH_CANCEL: dlg->direction = 0; GUICloseDialog( gui ); break; default : break; } return( true ); default : break; } return( false ); }
OVL_EXTERN bool ProgEvent( gui_window * gui, gui_event gui_ev, void * param ) { gui_ctl_id id; dlg_new_prog *dlg; dlg = GUIGetExtra( gui ); switch( gui_ev ) { case GUI_INIT_DIALOG: GUILimitEditText( gui, CTL_NEWP_PROG, UTIL_LEN - 1 ); GUILimitEditText( gui, CTL_NEWP_ARGS, UTIL_LEN - 1 ); GUISetText( gui, CTL_NEWP_PROG, dlg->prog ); GUISetText( gui, CTL_NEWP_ARGS, dlg->args ); GUISetFocus( gui, CTL_NEWP_PROG ); return( true ); case GUI_CONTROL_CLICKED : GUI_GETID( param, id ); switch( id ) { case CTL_NEWP_BROWSE: GUIDlgBuffGetText( gui, CTL_NEWP_PROG, TxtBuff, TXT_LEN ); if( !ExeBrowse() ) return( true ); GUISetText( gui, CTL_NEWP_PROG, TxtBuff ); GUISetFocus( gui, CTL_NEWP_PROG ); return( true ); case CTL_NEWP_OK: GUIDlgBuffGetText( gui, CTL_NEWP_PROG, prog, sizeof( prog ) ); GUIDlgBuffGetText( gui, CTL_NEWP_ARGS, args, sizeof( args ) ); dlg->cancel = false; GUICloseDialog( gui ); return( true ); case CTL_NEWP_CANCEL: GUICloseDialog( gui ); return( true ); } return( false ); case GUI_DESTROY: return( true ); } return( false ); }
OVL_EXTERN bool StkOrHistoryEvent( gui_window *gui, gui_event gui_ev, void *param ) { gui_ctl_id id; gui_ctl_id *resp; resp = GUIGetExtra( gui ); switch( gui_ev ) { case GUI_INIT_DIALOG: GUISetFocus( gui, CTL_STK_YES ); return( true ); case GUI_CONTROL_CLICKED : GUI_GETID( param, id ); switch( id ) { case CTL_STK_CANCEL: case CTL_STK_NO: case CTL_STK_YES: *resp = id; GUICloseDialog( gui ); return( true ); } return( false ); } return( false ); }
extern bool RXEvent( gui_window * gui, gui_event event, void * param ) { gui_ctl_id id; switch( event ) { case GUI_INIT_DIALOG: SetRXStatus( gui ); GUISetFocus( gui, CTL_RX_OK ); break; case GUI_CONTROL_CLICKED: GUI_GETID( param, id ); switch( id ) { case CTL_RX_OK: GetRXStatus( gui ); case CTL_RX_CANCEL: GUICloseDialog( gui ); break; } return( true ); default : break; } return( false ); }
static bool SourceEvent( gui_window *gui, gui_event gui_ev, void *param ) { gui_ctl_id id; void *curr; int i; int size; char *text; dlg_list *dlg; dlg = GUIGetExtra( gui ); switch( gui_ev ) { case GUI_DESTROY: WndFree( dlg->title ); return( true ); case GUI_INIT_DIALOG: GUISetWindowText( gui, dlg->title ); GUIClearList( gui, CTL_LIST_LIST ); for( curr = dlg->next( NULL ); curr != NULL; curr = dlg->next( curr ) ) { AddText( gui, dlg->name( curr ) ); } GUISetFocus( gui, CTL_LIST_EDIT ); return( true ); case GUI_CONTROL_CLICKED: GUI_GETID( param, id ); switch( id ) { case CTL_LIST_LIST: GUIDlgBuffGetText( gui, CTL_LIST_LIST, TxtBuff, TXT_LEN ); GUISetText( gui, CTL_LIST_EDIT, TxtBuff ); break; case CTL_LIST_DELETE: i = GUIGetCurrSelect( gui, CTL_LIST_LIST ); if( i != -1 ) { GUIDeleteItem( gui, CTL_LIST_LIST, i ); } size = GUIGetListSize( gui, CTL_LIST_LIST ); if( i < size ) { GUISetCurrSelect( gui, CTL_LIST_LIST, i ); } else { SelectListLast( gui ); } GUISetFocus( gui, CTL_LIST_LIST ); GUISetText( gui, CTL_LIST_EDIT, NULL ); break; case CTL_LIST_ADD: case CTL_LIST_OK: GUIDlgBuffGetText( gui, CTL_LIST_EDIT, TxtBuff, TXT_LEN ); if( TxtBuff[0] != '\0' ) AddText( gui, TxtBuff ); SelectListLast( gui ); GUIClearText( gui, CTL_LIST_EDIT ); GUISetFocus( gui, CTL_LIST_EDIT ); if( id == CTL_LIST_ADD ) break; dlg->clear(); size = GUIGetListSize( gui, CTL_LIST_LIST ); for( i = 0; i < size; ++i ) { text = GUIGetListItem( gui, CTL_LIST_LIST, i ); if( text != NULL ) { dlg->add( text, strlen( text ) ); GUIMemFree( text ); } } /* fall through */ case CTL_LIST_CANCEL: GUICloseDialog( gui ); break; case CTL_LIST_BROWSE: GUIDlgBuffGetText( gui, CTL_LIST_EDIT, TxtBuff, TXT_LEN ); if( !AllBrowse( TxtBuff ) ) return( true ); GUISetText( gui, CTL_LIST_EDIT, TxtBuff ); GUISetFocus( gui, CTL_LIST_EDIT ); return( true ); } return( true ); default: return( false ); } }
/* * GetFileNameEvent - event handler for GetFileName dialog */ extern bool GetFileNameEvent( gui_window *gui, gui_event gui_ev, void *param ) { unsigned id; int sel; char *ptr; char path[_MAX_PATH]; dlg_info *dlg = GUIGetExtra( gui ); switch( gui_ev ) { case GUI_INIT_DIALOG: dlg->initted = false; InitTextList( gui, CTL_FILE_TYPES, GetFileTypesTextList() ); #if !defined( __UNIX__ ) && !defined( __NETWARE__ ) InitTextList( gui, CTL_DRIVES, GetDriveTextList() ); #endif if( !initDialog( gui, dlg->fileExtensions[dlg->currExtIndex], dlg->currOFN->file_name ) ) { dlg->dialogRC = OFN_RC_FAILED_TO_INITIALIZE; return( false ); } dlg->initted = true; GUISetFocus( gui, CTL_EDIT ); return( true ); break; case GUI_CONTROL_DCLICKED: GUI_GETID( param, id ); switch( id ) { case CTL_FILE_LIST: case CTL_DIR_LIST: ProcessOKorDClick( gui, id ); break; } break; case GUI_CONTROL_CLICKED: if( !dlg->initted ) break; GUI_GETID( param, id ); switch( id ) { case CTL_OK: ProcessOKorDClick( gui, id ); break; case CTL_CANCEL: GUICloseDialog( gui ); break; case CTL_FILE_LIST: ptr = GUIGetText( gui, id ); GUISetText( gui, CTL_EDIT, ptr ); GUIMemFree( ptr ); break; case CTL_DRIVES : sel = GUIGetCurrSelect( gui, id ); strcpy( path, GetDriveTextList()[sel] ); path[2] = 0; goToDir( gui, path ); if( !initDialog( gui, NULL, NULL ) ) { dlg->dialogRC = OFN_RC_RUNTIME_ERROR; GUICloseDialog( gui ); } break; case CTL_FILE_TYPES: sel = GUIGetCurrSelect( gui, id ); if( !initDialog( gui, dlg->fileExtensions[sel], NULL ) ) { dlg->dialogRC = OFN_RC_RUNTIME_ERROR; GUICloseDialog( gui ); } break; } return( true ); default: break; // makes GCC happy. } return( false ); } /* GetFileNameEvent */
static bool GenericEventProc( gui_window *gui, gui_event gui_ev, void *param ) /****************************************************************************/ { #if !defined( _UI ) static bool first_time = TRUE; #endif unsigned id; DLG_WINDOW_SET *result; a_dialog_header *curr_dialog; static int initializing = FALSE; char buff[MAXBUF]; gui_text_metrics metrics; if( gui == NULL ) return( FALSE ); result = GUIGetExtra( gui ); curr_dialog = result->current_dialog; switch( gui_ev ) { case GUI_INIT_DIALOG: initializing = TRUE; UpdateControlVisibility( gui, curr_dialog, TRUE ); SetDefaultVals( gui, curr_dialog ); SetFocusCtrl( gui, curr_dialog ); GUIGetTextMetrics( gui, &metrics ); if( stricmp( curr_dialog->name, "InsertDisk" ) == 0 ) { DoBeep(); } #if defined( __OS2__ ) { int i; for( i = 0; i < curr_dialog->num_controls; i++ ) { if( curr_dialog->controls[i].control_class == GUI_EDIT_MLE ) { GUILimitEditText( gui, curr_dialog->controls[i].id, -1 ); GUISetText( gui, curr_dialog->controls[i].id, curr_dialog->controls[i].text ); } } } #endif #if defined( _UI ) if( stricmp( curr_dialog->name, "Welcome" ) == 0 ) { if( GetVariableIntVal( "AutoOptionsDialog" ) == 1 ) { // call Options dialog DoDialogWithParent( gui, "Options" ); } } #endif #if !defined( _UI ) first_time = TRUE; #endif initializing = FALSE; return( TRUE ); #if !defined( _UI ) case GUI_PAINT: if( first_time ) { first_time = FALSE; if( stricmp( curr_dialog->name, "Welcome" ) == 0 ) { if( GetVariableIntVal( "AutoOptionsDialog" ) == 1 ) { // call Options dialog DoDialogWithParent( gui, "Options" ); } } } break; #endif case GUI_DESTROY: break; case GUI_CONTROL_CLICKED : GUI_GETID( param, id ); switch( id ) { case CTL_OK: case CTL_PREVIOUS: case CTL_FIRST: case CTL_SKIP: GetVariableVals( gui, curr_dialog, TRUE ); GUICloseDialog( gui ); result->state = IdToDlgState( id ); break; case CTL_CANCEL: GUICloseDialog( gui ); result->state = DLG_CAN; break; case CTL_DONE: GUICloseDialog( gui ); result->state = DLG_DONE; break; case CTL_OPTIONS: // Options button on Welcome dialog // call Options dialog DoDialogWithParent( gui, "Options" ); GetVariableVals( gui, curr_dialog, FALSE ); break; default: { const char *dlg_name; a_dialog_header *child; int old_val; dlg_state return_state; dlg_name = VarGetStrVal( GetVariableById( id ) ); if( dlg_name != NULL ) { child = FindDialogByName( dlg_name ); if( child != NULL ) { GetVariableVals( gui, curr_dialog, FALSE ); if( child->any_check != NO_VAR ) { old_val = VarGetIntVal( child->any_check ); SetVariableByHandle( child->any_check, "1" ); GUISetChecked( gui, VarGetId( child->any_check ), 1 ); CheckChildChecks( child ); return_state = DoDialogByPointer( gui, child ); if( return_state != DLG_CAN && return_state != DLG_DONE ) { CheckAnyCheck( gui, child ); } else { SetVariableByHandle( child->any_check, old_val ? "1" : "0" ); GUISetChecked( gui, VarGetId( child->any_check ), old_val ); } } else { DoDialogByPointer( gui, child ); } } } } if( !initializing ) GetVariableVals( gui, curr_dialog, FALSE ); UpdateControlVisibility( gui, curr_dialog, FALSE ); break; case CTL_HELP: strcpy( buff, "Help_" ); strcat( buff, curr_dialog->name ); DoDialogWithParent( gui, buff ); break; } return( TRUE ); default: break; } return( FALSE ); }
static bool StatusEventProc( gui_window *gui, gui_event gui_ev, void *parm ) /**************************************************************************/ { static bool button_pressed = false; gui_ctl_id id; gui_key key; gui_keystate state; const char *msg; parm = parm; if( gui == NULL ) return( false ); switch( gui_ev ) { case GUI_INIT_WINDOW: return( true ); case GUI_PAINT: { if( StatusBarLen == 0 ) { break; } msg = GetVariableStrVal( Messages[MsgLine0] ); GUIDrawTextExtent( gui, msg, strlen( msg ), LINE0_ROW, LINE0_COL * CharSize.x, WND_STATUS_TEXT, GUI_NO_COLUMN ); GUIDrawTextExtent( gui, StatusLine1, strlen( StatusLine1 ), LINE1_ROW, LINE1_COL * CharSize.x, WND_STATUS_TEXT, GUI_NO_COLUMN ); #ifdef _UI { int len1, len2; char num[20]; memset( StatusBarBuf, ' ', StatusBarLen ); StatusBarBuf[StatusBarLen] = '\0'; itoa( Percent, num, 10 ); strcat( num, "%" ); memcpy( StatusBarBuf + StatusBarLen / 2 - 1, num, strlen( num ) ); // draw bar in two parts len1 = (StatusBarLen * (long)Percent) / 100; if( len1 < 0 ) { len1 = 0; } else if( len1 > StatusBarLen ) { len1 = StatusBarLen; } len2 = StatusBarLen - len1; if( len1 > 0 ) { GUIDrawText( gui, StatusBarBuf, len1, STATUS_ROW, StatusBarRect.x, WND_STATUS_BAR ); } if( len2 > 0 ) { GUIDrawText( gui, StatusBarBuf + len1, len2, STATUS_ROW, StatusBarRect.x + len1 * CharSize.x, WND_STATUS_TEXT ); } memset( StatusBarBuf, UiGChar[UI_SBOX_TOP_LINE], StatusBarLen ); GUIDrawText( gui, StatusBarBuf, StatusBarLen, STATUS_ROW - 1, StatusBarRect.x, WND_STATUS_TEXT ); GUIDrawText( gui, StatusBarBuf, StatusBarLen, STATUS_ROW + 1, StatusBarRect.x, WND_STATUS_TEXT ); } #else { gui_coord coord; int str_len, width, height; int bar_width, len1, len2, divider; gui_point start, end; gui_rect rStatusBar; // sprintf( StatusBarBuf, "%d%%", Percent ); // clear whole bar GUIFillRect( gui, &StatusBarRect, WND_STATUS_BAR ); // calculate where divider splits rectangle bar_width = StatusBarRect.width; divider = (bar_width * (long)Percent) / 100; if( divider < 0 ) { divider = 0; } else if( divider > bar_width ) { divider = bar_width; } rStatusBar = StatusBarRect; rStatusBar.width = divider; // calculate position for text (centre it) str_len = strlen( StatusBarBuf ); width = GUIGetExtentX( gui, StatusBarBuf, str_len ); height = GUIGetExtentY( gui, StatusBarBuf ); coord.y = StatusBarRect.y + (StatusBarRect.height - height) / 2; coord.x = StatusBarRect.x + (StatusBarRect.width - width) / 2; divider += StatusBarRect.x; if( coord.x > divider ) { // text is completely to right of divider GUIFillRect( gui, &rStatusBar, WND_STATUS_TEXT ); GUIDrawTextPos( gui, StatusBarBuf, str_len, &coord, WND_STATUS_TEXT ); } else if( coord.x + width < divider ) { // text is completely to left of divider GUIFillRect( gui, &rStatusBar, WND_STATUS_TEXT ); GUIDrawTextPos( gui, StatusBarBuf, str_len, &coord, WND_STATUS_BAR ); } else { // need to split text len1 = ((long)(divider - coord.x) * str_len) / width; if( len1 < 0 ) { len1 = 0; } else if( len1 > str_len ) { len1 = str_len; } len2 = str_len - len1; // recalc divider, so it falls on a character boundary divider = coord.x + GUIGetExtentX( gui, StatusBarBuf, len1 ); rStatusBar.width = divider - StatusBarRect.x; GUIFillRect( gui, &rStatusBar, WND_STATUS_TEXT ); if( len1 > 0 ) { GUIDrawTextPos( gui, StatusBarBuf, len1, &coord, WND_STATUS_BAR ); } if( len2 > 0 ) { coord.x = divider; GUIDrawTextPos( gui, StatusBarBuf + len1, len2, &coord, WND_STATUS_TEXT ); } } // draw frame start.x = StatusBarRect.x; start.y = StatusBarRect.y; end.x = StatusBarRect.width + StatusBarRect.x; end.y = start.y; // top line GUIDrawLine( gui, &start, &end, GUI_PEN_SOLID, 1, WND_STATUS_FRAME ); start.y = StatusBarRect.y + StatusBarRect.height; // bottom line end.y = start.y; GUIDrawLine( gui, &start, &end, GUI_PEN_SOLID, 1, WND_STATUS_FRAME ); end.y = StatusBarRect.y; start.x = StatusBarRect.x; end.x = start.x; // left side GUIDrawLine( gui, &start, &end, GUI_PEN_SOLID, 1, WND_STATUS_FRAME ); start.x = StatusBarRect.x + StatusBarRect.width; end.x = start.x; // right side GUIDrawLine( gui, &start, &end, GUI_PEN_SOLID, 1, WND_STATUS_FRAME ); } #endif return( false ); } case GUI_DESTROY: StatusWnd = NULL; return( false ); case GUI_CONTROL_CLICKED: GUIGetFocus( gui, &id ); GUI_GETID( parm, id ); switch( id ) { case CTL_CANCEL: if( !button_pressed ) { button_pressed = true; if( MsgBox( gui, "IDS_QUERYABORT", GUI_YES_NO ) == GUI_RET_YES ) { CancelSetup = true; } button_pressed = false; break; } case CTL_DONE: if( !button_pressed ) { CancelSetup = true; break; } } return( true ); case GUI_KEYDOWN: GUI_GET_KEY_STATE( parm, key, state ); state = state; switch( key ) { case GUI_KEY_ESCAPE: if( !button_pressed ) { button_pressed = true; if( MsgBox( gui, "IDS_QUERYABORT", GUI_YES_NO ) == GUI_RET_YES ) { CancelSetup = true; } button_pressed = false; break; } default: break; } return( true ); default: break; } return( false ); }