// DrawStatusLine(): // Called to draw the Status Line. void DrawStatusLine(LWControl *ctl, FreeKeyInterface *ui, DrMode mode) { CDrawFuncs *df = fk_int->panel_funcs->DrawFuncs; int cx = CON_HOTX( ctl ); int cy = CON_HOTY( ctl ); int cw = CON_HOTW( ctl ); int ch = CON_HOTH( ctl ); if( fk_int->processing ) { // Progress Bar Drawing // Draw the bar df->DrawRGBBox( fk_int->main_panel, 0, 60, 150, cx+1, cy+1, (int)( (cw-2) * ((double)fk_int->progress_cur / (double)fk_int->progress_total) ), ch-2 ); // Clear the area outside the bar df->DrawRGBBox( fk_int->main_panel, 132, 130, 132, cx + (cw-2) * ((double)fk_int->progress_cur / (double)fk_int->progress_total) + 1, cy+1, cw - (int)( ((double)(cw-2) * ((double)fk_int->progress_cur / (double)fk_int->progress_total)) - 2), ch-2 ); // Write the name of the current object on the bar df->WriteText( fk_int->main_panel, fk_int->status_text, COLOR_WHITE, cx+4, cy ); } else { // Standard Message Drawing if( fk_int->status_mode == STATUSMODE_ERROR ) { df->DrawRGBBox( fk_int->main_panel, 175, 0, 0, cx+1, cy+1, cw-2, ch-2 ); df->WriteText( fk_int->main_panel, fk_int->status_text, COLOR_LT_YELLOW, cx+4, cy ); } else if( fk_int->status_mode == STATUSMODE_NOTICE ) { df->DrawRGBBox( fk_int->main_panel, 200, 185, 0, cx+1, cy+1, cw-2, ch-2 ); df->WriteText( fk_int->main_panel, fk_int->status_text, COLOR_BLACK, cx+4, cy ); } else { // Default to Info mode df->DrawRGBBox( fk_int->main_panel, 132, 130, 132, cx+1, cy+1, cw-2, ch-2 ); df->WriteText( fk_int->main_panel, fk_int->status_text, COLOR_BLACK, cx+4, cy ); } } }
// DrawProcessPanel(): // Called to draw the Processing Panel void DrawProcessPanel( LWPanelID panel, void *data, DrMode mode ) { CDrawFuncs *df = fk_int->panel_funcs->DrawFuncs; int y = CON_Y( fk_int->progress_bar ); int pw = PAN_GETW( fk_int->panel_funcs->orig_struct, fk_int->process_panel ); df->WriteText( fk_int->process_panel, "Processing...", COLOR_BLACK, (pw/2)-(df->TextWidth(fk_int->process_panel, "Processing..."))/2, y-15 ); df->WriteText( fk_int->process_panel, "(Press OK to abort)", COLOR_BLACK, (pw/2)-(df->TextWidth(fk_int->process_panel, "(Press OK to abort)"))/2, y+30 ); processing_open = true; }
// DrawKeysPanel(): // Called to draw the Keyboard Help Panel void DrawKeysPanel( LWPanelID panel, void *data, DrMode mode ) { CDrawFuncs *df = fk_int->panel_funcs->DrawFuncs; int ph = PAN_GETH( fk_int->panel_funcs->orig_struct, fk_int->keys_panel ); int pw = PAN_GETW( fk_int->panel_funcs->orig_struct, fk_int->keys_panel ); const int column_center = 170; int y = 5; for( int i=0; keys_text[i] != NULL; i+=2 ) { df->WriteText( fk_int->keys_panel, keys_text[i], COLOR_WHITE, column_center - 5 - df->TextWidth(fk_int->about_panel, keys_text[i]), y ); df->WriteText( fk_int->keys_panel, keys_text[i+1], COLOR_BLACK, column_center + 5, y ); y += 15; } }
// DrawProgressBar(): // Called to draw the Progress Bar. void DrawProgressBar(LWControl *ctl, FreeKeyInterface *ui, DrMode mode) { if( !processing_open ) return; CDrawFuncs *df = fk_int->panel_funcs->DrawFuncs; int cx = CON_X( ctl ); int cy = CON_Y( ctl ); int cw = CON_W( ctl ); int ch = CON_H( ctl ); // Clear the control df->DrawBox( fk_int->process_panel, COLOR_BG, cx+1, cy+1, cw-2, ch-2 ); // Draw the bar df->DrawRGBBox( fk_int->process_panel, 0, 200, 200, cx+1, cy+1, (cw-2) * (fk_int->progress_cur / fk_int->progress_total), ch-2 ); // Write the name of the current object on the bar df->WriteText( fk_int->process_panel, fk_int->progress_name, COLOR_WHITE, cx, cy+2 ); }
// DrawMSZoom(): // Draws the lower scroll bar in the MultiScroll void DrawMSZoom() { CDrawFuncs *df = fk_int->panel_funcs->DrawFuncs; int cx = CON_HOTX( fk_int->item_multiscroll ); int cy = CON_HOTY( fk_int->item_multiscroll ); int ch = CON_HOTH( fk_int->item_multiscroll ); // Zoom Out PanelDraw::Button( fk_int->main_panel, df, cx+fk_int->ms_divider-25, cy, 20, ch, 1, 1, LW_BUTTON_COLOR_PURPLE ); int bx = cx+fk_int->ms_divider-25; PanelDraw::DrawArrow( fk_int->main_panel, df, bx+10, cy+(ch/2), PanelDraw::arrow_toward_vert, PanelDraw::arrow_two_edges ); // Zoom Slider PanelDraw::Button( fk_int->main_panel, df, cx+fk_int->ms_divider-105, cy, 80, ch, 1, 1, LW_BUTTON_COLOR_GREEN ); bx = cx+fk_int->ms_divider-105; df->DrawRGBBox( fk_int->main_panel, 90, 105, 90, bx+8, cy+3, 64, 1 ); df->DrawRGBBox( fk_int->main_panel, 30, 60, 30, bx+8, cy+4, 64, 1 ); df->DrawRGBBox( fk_int->main_panel, 222, 235, 222, bx+8, cy+5, 64, 1 ); PanelDraw::DrawArrow( fk_int->main_panel, df, bx+70 - (int)( fk_int->ms_zoom * 60.0 ), cy+(ch/2)+1, PanelDraw::arrow_up, PanelDraw::arrow_empty ); // Zoom In PanelDraw::Button( fk_int->main_panel, df, cx+fk_int->ms_divider-125, cy, 20, ch, 1, 1, LW_BUTTON_COLOR_PURPLE ); bx = cx+fk_int->ms_divider-125; PanelDraw::DrawArrow( fk_int->main_panel, df, bx+10, cy+(ch/2), PanelDraw::arrow_away_vert, PanelDraw::arrow_two_edges ); // Zoom Factor Text char zoom_text[20]; sprintf( zoom_text, "%g%%", fk_int->ms_zoom * 100.0 ); df->WriteText( fk_int->main_panel, zoom_text, COLOR_LT_YELLOW, cx+3, cy ); }
// DrawRegisterPanel(): // Called to draw the Register Panel void DrawRegisterPanel( LWPanelID panel_id, void *panel_user, DrMode panel_draw_mode ) { CDrawFuncs *df = fk_int->panel_funcs->DrawFuncs; // Title Image logo.DrawInLWPanels( fk_int->fkd->register_panel, df, -280, 0 ); int ph = PAN_GETH( fk_int->panel_funcs->orig_struct, fk_int->fkd->register_panel ); int pw = PAN_GETW( fk_int->panel_funcs->orig_struct, fk_int->fkd->register_panel ); int y = 85; for( int i=0; register_text[i] != NULL; i++ ) { df->WriteText( fk_int->fkd->register_panel, (char *)register_text[i], COLOR_BLACK, (pw/2)-(df->TextWidth(fk_int->fkd->register_panel, (char *)(register_text[i]) ))/2, y ); y += 15; } y = CON_Y( fk_int->fkd->register_now ) + 50; df->WriteText( fk_int->fkd->register_panel, (char *)trial_text, COLOR_BLACK, (pw/2)-(df->TextWidth(fk_int->fkd->register_panel, (char *)(trial_text) ))/2, y ); }