ct_image_window::ct_image_window( ) { Fl_Double_Window* w; { Fl_Double_Window* o = image_window = new Fl_Double_Window(421, 528); w = o; o->user_data((void*)(this)); { Fl_Group* o = new Fl_Group(5, 30, 410, 410); o->box(FL_PLASTIC_DOWN_FRAME); { ct_draw_area* o = ct_image = new ct_draw_area(10, 35, 400, 400, "label"); o->box(FL_FLAT_BOX); o->color(FL_DARK3); o->selection_color(FL_BACKGROUND_COLOR); o->labeltype(FL_NORMAL_LABEL); o->labelfont(0); o->labelsize(14); o->labelcolor(FL_BLACK); o->align(FL_ALIGN_CENTER); o->when(FL_WHEN_RELEASE); } o->end(); } { Fl_Menu_Bar* o = new Fl_Menu_Bar(0, 0, 100, 25); o->box(FL_FLAT_BOX); o->menu(menu_); } { Fl_Value_Slider* o = WL = new Fl_Value_Slider(40, 470, 375, 20, "WL"); o->type(1); o->box(FL_PLASTIC_THIN_DOWN_BOX); o->minimum(-2000); o->maximum(7000); o->step(1); o->value(40); o->callback((Fl_Callback*)cb_WL); o->align(FL_ALIGN_LEFT); } { Fl_Value_Slider* o = WW = new Fl_Value_Slider(40, 495, 375, 20, "WW"); o->type(1); o->box(FL_PLASTIC_THIN_DOWN_BOX); o->minimum(1); o->maximum(4000); o->step(1); o->value(300); o->callback((Fl_Callback*)cb_WW); o->align(FL_ALIGN_LEFT); } { Fl_Value_Slider* o = Indx = new Fl_Value_Slider(40, 445, 375, 20, "Indx"); o->type(1); o->box(FL_PLASTIC_THIN_DOWN_BOX); o->step(1); o->callback((Fl_Callback*)cb_Indx); o->align(FL_ALIGN_LEFT); } { Fl_Progress* o = progress_bar = new Fl_Progress(115, 5, 300, 20); o->box(FL_PLASTIC_THIN_UP_BOX); o->selection_color((Fl_Color)1); o->hide(); } o->end(); } }
void MainWindow::createComponents() { Fl_Group* grpSequence = new Fl_Group(10,20,150,120, "Sequence :"); if ( grpSequence != NULL ) { grpSequence->box(FL_DOWN_BOX); grpSequence->align(Fl_Align(FL_ALIGN_TOP_LEFT)); grpSequence->labelsize(DEFAULT_FONT_SIZE); grpSequence->begin(); seqPreparing = new Fl_Box(20,30,130,20,"1. Preparing update ..."); if ( seqPreparing != NULL ) { seqPreparing->align( FL_ALIGN_LEFT | FL_ALIGN_INSIDE ); seqPreparing->labelsize(DEFAULT_FONT_SIZE); seqPreparing->deactivate(); } seqRetrieving = new Fl_Box(20,50,130,20,"2. Retrieving data ..."); if ( seqRetrieving != NULL ) { seqRetrieving->align( FL_ALIGN_LEFT | FL_ALIGN_INSIDE ); seqRetrieving->labelsize(DEFAULT_FONT_SIZE); seqRetrieving->deactivate(); } seqProcessing = new Fl_Box(20,70,130,20,"3. Processing data ..."); if ( seqProcessing != NULL ) { seqProcessing->align( FL_ALIGN_LEFT | FL_ALIGN_INSIDE ); seqProcessing->labelsize(DEFAULT_FONT_SIZE); seqProcessing->deactivate(); } seqUpdating = new Fl_Box(20,90,130,20,"4. Updating ..."); if ( seqUpdating != NULL ) { seqUpdating->align( FL_ALIGN_LEFT | FL_ALIGN_INSIDE ); seqUpdating->labelsize(DEFAULT_FONT_SIZE); seqUpdating->deactivate(); } seqFinalizing = new Fl_Box(20,110,130,20,"5. Finalizing ..."); if ( seqFinalizing != NULL ) { seqFinalizing->align( FL_ALIGN_LEFT | FL_ALIGN_INSIDE ); seqFinalizing->labelsize(DEFAULT_FONT_SIZE); seqFinalizing->deactivate(); } grpSequence->end(); progBar = new Fl_Progress(10,150,150,10); if ( progBar != NULL ) { progBar->color2(FL_BLUE); progBar->maximum(5); progBar->minimum(0); progBar->value(0); } mli_info = new Fl_Box(170,20,220,140,""); if ( mli_info != NULL ) { mli_info->box( FL_DOWN_BOX ); mli_info->align( FL_ALIGN_TOP_LEFT | FL_ALIGN_INSIDE ); mli_info->labelsize(DEFAULT_FONT_SIZE); } Fl_Box* boxCopyright = new Fl_Box(10,165,380,35); if ( boxCopyright != NULL ) { boxCopyright->box(FL_DOWN_BOX); boxCopyright->align( FL_ALIGN_TOP_LEFT | FL_ALIGN_INSIDE ); boxCopyright->labelsize(COPYRIGHT_FONT_SIZE); boxCopyright->label("Automatic Updater, (C)Copyright 2013 Rageworx freeware.\n" "All rights reserved, [email protected]"); } } }
Fl_Font_Browser::Fl_Font_Browser():Fl_Window(100,100,550-60,332-5,"Font Browser") { lst_Font = new Fl_Browser(15, 55-5, 195, 159); lst_Font->labelsize(12); lst_Font->textsize(12); lst_Font->callback((Fl_Callback*)cb_FontName_Selected, (void*)(lst_Font->parent())); lst_Font->type(FL_HOLD_BROWSER); txt_InputFont = new Fl_Input(15, 31-5, 195, 24, "Font:"); txt_InputFont->labelsize(12); txt_InputFont->textsize(12); txt_InputFont->align(FL_ALIGN_TOP_LEFT); txt_InputFont->when(FL_WHEN_ENTER_KEY); txt_InputFont->callback((Fl_Callback*)cb_txtInputFontName, (void*)(txt_InputFont->parent())); lst_Style = new Fl_Browser(215, 56-5, 155-60, 159); lst_Style->labelsize(12); lst_Style->type(FL_HOLD_BROWSER); lst_Style->textsize(12); lst_Style->callback((Fl_Callback*)cb_StyleSelected, (void*)(lst_Style->parent())); txt_InputStyle = new Fl_Input(215, 32-5, 155-60, 24, "Syle:"); txt_InputStyle->labelsize(12); txt_InputStyle->align(FL_ALIGN_TOP_LEFT); txt_InputStyle->textsize(12); txt_InputStyle->callback((Fl_Callback*)cb_txtInputFontStyle, (void*)(txt_InputStyle->parent())); lst_Size = new Fl_Browser(375-60, 56-5, 75, 159); lst_Size->labelsize(12); lst_Size->type(FL_HOLD_BROWSER); lst_Size->textsize(12); lst_Size->callback((Fl_Callback*)cb_FontSize_Selected, (void*)(lst_Size->parent())); txt_InputSize = new Fl_Input(375-60, 32-5, 75, 24, "Size:"); txt_InputSize->labelsize(12); txt_InputSize->align(FL_ALIGN_TOP_LEFT); txt_InputSize->textsize(12); txt_InputSize->callback((Fl_Callback*)cb_txtInputFontSize, (void*)(txt_InputSize->parent())); btn_OK =new Fl_Button(475-60, 35-5, 64, 20, "&OK"); btn_OK->shortcut(0x8006f); btn_OK->labelfont(1); btn_OK->labelsize(12); btn_OK->callback((Fl_Callback*)cb_okBtn_Red ); btn_Cancel =new Fl_Button(475-60, 60-5, 64, 20, "Cancel"); btn_Cancel->labelsize(12); btn_Cancel->callback((Fl_Callback*)cb_Cancel, (void *)(btn_Cancel->parent())); Fl_Box* o = new Fl_Box(15, 220-5, 20, 10, "Properties"); o->box(FL_BORDER_FRAME); o->labelsize(12); o->align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE); btn_Check1= new Fl_Check_Button(40-20, 250-5-5, 100, 15, "Strikethrough"); btn_Check1->down_box(FL_DOWN_BOX); btn_Check1->labelsize(12); btn_Check1->callback((Fl_Callback*)cb_Strikethrough, (void *)(btn_Check1->parent())); btn_Check2 = new Fl_Check_Button(40-20, 270-5-5, 100, 15, "Underline"); btn_Check2->down_box(FL_DOWN_BOX); btn_Check2->labelsize(12); btn_Check2->callback((Fl_Callback*)cb_UnderLine, (void *)(btn_Check2->parent())); btn_Color = new Fl_Button(40-20, 307-10-5, 90, 23, "Color:"); btn_Color->down_box(FL_BORDER_BOX); btn_Color->labelsize(12); btn_Color->align(FL_ALIGN_TOP_LEFT); btn_Color->color(FL_BLACK); btn_Color->callback((Fl_Callback*)cb_Color_Select, (void *)(lst_Size->parent())); { Fl_Group* o = new Fl_Group(130, 220-5, 256+180, 82, "Example"); o->box(FL_BORDER_FRAME); o->labelsize(12); o->align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE); { box_Example = new Fl_Font_Preview_Box(132-10, 241-5, 227+50+35+10, 48, "AaBbCcDdEeFfGgHhIi"); box_Example->box(FL_DOWN_BOX); box_Example->labelsize(12); box_Example->align(FL_ALIGN_WRAP|FL_ALIGN_CLIP|FL_ALIGN_CENTER|FL_ALIGN_INSIDE); } o->end(); } set_modal(); end(); // Initializations pickedsize = 14; // Font Size to be used // int k = Fl::set_fonts(0); // Nr of fonts available on the server for(int i= 0; i < k; i++) { int t; const char *name = Fl::get_font_name((Fl_Font)i,&t); char buffer[128]; // Load the font list .. Ignore the bold and italic types of the font if(!((t & FL_BOLD) ||(t & FL_ITALIC))) { sprintf(buffer, "%s",name); lst_Font->add(buffer); } } /* FL_Browser uses the symbol "@" as a formating char. There are some fonts that there names starts with char "@". We need to disable this */ lst_Font->format_char(0); // Sort the font Alphabetically ForwardSort(lst_Font); lst_Font->value(1); // Select the first font in the list lst_Style->value(1); lst_Font->do_callback(); // Do font selected callback .. to draw the preview lst_Style->do_callback(); this->callback_ = 0; // Initialize Widgets callback this->data_ = 0; // And the data }