/*********************************************************************** * Copyright (C) 2021 Prosource (CLI Systems LLC) * https://prosource.dev * * License: * THIS SOURCE CODE IS PART OF THE prosource.dev EMBEDDED SYSTEM * KNOWLEDGE-BASE. This source code is a Free Solution as defined * in the Prosource Usage License and is provided under the * Creative Commons Attribution 4.0 International (CC BY 4.0) license * as defined at https://creativecommons.org/licenses/by/4.0/ * * This source code and all software distributed under the License are * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED * ***********************************************************************/ #include #include #include #include #include #include #include #include #include #include #include #include namespace ACG { class Main_Window : public Fl_Window { public: Main_Window() : Fl_Window(240, 320,"Demo Program test1") { box1 = new Fl_Box(FL_ROUNDED_BOX, 100, 0, 140, 100, "Hello"); box1->align(FL_ALIGN_INSIDE|FL_ALIGN_TOP | FL_ALIGN_LEFT | FL_ALIGN_CLIP); box1->labelfont(FL_HELVETICA_BOLD_ITALIC); box1->labelsize(36); box1->labelcolor(fl_rgb_color(0x00, 0x80, 0x00)); box1->labeltype(FL_EMBOSSED_LABEL); btn = new Fl_Button(0, 0, 100, 40,"@+2reload Reload"); lbutton = new Fl_Light_Button(0, 40, 100, 40,"Light lock"); lbutton->color2(FL_BLUE); cbutton = new Fl_Check_Button(0,80, 100, 40, "check?"); input = new Fl_Input(0, 120, 240, 40, "label"); input->value("Four score and seven years ago"); dial = new Fl_Dial(0,175,100,100,"Dial1"); dial->type(FL_LINE_DIAL); dial->color(FL_RED); dial->color2(FL_GREEN); dial->labeltype(FL_SHADOW_LABEL); slide = new Fl_Slider(130,175,100,40,"slider1"); slide->type(FL_HOR_FILL_SLIDER); slide->color(FL_RED); slide->color2(FL_GREEN); slide->labeltype(FL_ENGRAVED_LABEL); roller = new Fl_Roller(130,240,100,40,"Roller1"); roller->type(FL_HORIZONTAL); roller->labelcolor(FL_BLUE); roller->callback(roller_callback, (void*)this); roller->step(0.05); } static void roller_callback(Fl_Widget *w, void *data) { printf("Got callback!"); printf("Roller value %f\n",((Fl_Roller*)w)->value()); } private: Fl_Box * box1; Fl_Button * btn; Fl_Light_Button * lbutton; Fl_Check_Button * cbutton; Fl_Input *input; Fl_Dial * dial; Fl_Slider * slide; Fl_Roller * roller; }; } int main(int argc, char *argv[]) { int ret; ACG::Main_Window window; Fl::visual(FL_RGB); window.show(); ret=Fl::run(); printf("**Normal exit, ret %d\n",ret); return ret; }