Esempio n. 1
0
void MainWindow::Execute(void* p)
{
    Fl_Double_Window* window = new Fl_Double_Window(ALIAS_WINDOW);

    if ( window != NULL )
    {
        extern HINSTANCE fl_display;
        window->icon((char *)LoadIcon(fl_display, MAKEINTRESOURCE(IDI_ICON_MAIN)));

        window->label("Automatic Upgrader WIN32");
        window->labelsize(DEFAULT_FONT_SIZE);
        window->begin();

        createComponents();

        window->end();
        window->show( _argc, _argv );
        window->callback(window_callback);

        Fl::add_timeout(0.5f, timer_cb, this);

        Fl::scheme("plastic");

        returnCode = Fl::run();
    }

    stillAlive = false;
}
Esempio n. 2
0
int main() {
	fl_open_display();

	Fl_Double_Window* win = new Fl_Double_Window(295, 144, "Notify test");
	win->begin();
		txt = new Fl_Input(10, 15, 275, 25);
		txt->align(FL_ALIGN_TOP_LEFT);

		color_button = new Fl_Button(260, 50, 25, 25, "Color");
		color_button->align(FL_ALIGN_LEFT);
		color_button->callback(color_cb);
		Fl_Box* bx = new Fl_Box(10, 50, 164, 85, "Type some text and choose color, then press Send. "
		"Desktop should get notified about this.");
		bx->align(FL_ALIGN_WRAP);

		Fl_Button* send_button = new Fl_Button(195, 110, 90, 25, "&Send");
		send_button->callback(send_cb);
	win->end();
	win->show();
	return Fl::run();
}
Esempio n. 3
0
int main(void) {
	Fl_Double_Window* win = new Fl_Double_Window(240, 165, "SevenSeg sample");
	win->begin();
		seg = new edelib::SevenSeg(10, 10, 70, 92);
		seg->box(FL_UP_BOX);
		seg->value(0);

		counter = new Fl_Counter(95, 20, 135, 20, "value");
		counter->type(1);
		counter->step(1);
		counter->minimum(-1);
		counter->maximum(9);
		counter->align(FL_ALIGN_TOP_LEFT);
		counter->callback(change_cb);

		slider = new Fl_Value_Slider(95, 65, 135, 20, "width");
		slider->type(1);
		slider->step(1);
		slider->minimum(2);
		slider->maximum(20);
		slider->value(seg->bar_width());
		slider->align(FL_ALIGN_TOP_LEFT);
		slider->callback(slide_cb);

		color_button = new Fl_Button(205, 95, 25, 25, "color");
		color_button->align(FL_ALIGN_LEFT);
		color_button->callback(color_cb);
		color_button->color(seg->color());

		chk = new Fl_Check_Button(95, 130, 135, 25, "deactivate");
		chk->down_box(FL_DOWN_BOX);
		chk->callback(deactivate_cb);
	win->end();
	win->show();
	return Fl::run();
}
Esempio n. 4
0
//heres the money.....
int main(int argc, char* argv[])
{
    
    //make the frame
    Fl_Double_Window *w = new Fl_Double_Window( 820, 460, "uMS" );
    w->size_range(DEFAULT_WIDTH,DEFAULT_HEIGHT);
    
    //OK - lets build a whole set of panes
    std::string sWho;
    {
        //note scoping
        Fl_Preferences app( Fl_Preferences::USER, "MOOS", "uMS" );
        char Space[2048];
        app.get("Communities",Space,"Unnamed:9000@LOCALHOST",sizeof(Space));
        sWho = std::string(Space);
    }
    
    Fl_Tabs* pTab = new Fl_Tabs(10, 10, 800, 400);
    
    while(!sWho.empty())
    {
        std::string sChunk = MOOSChomp(sWho,",");
        std::string sName = MOOSChomp(sChunk,":");
        int nPort = atoi(MOOSChomp(sChunk,"@").c_str());
        std::string sHost = sChunk;
        if(!sChunk.empty() && nPort>0)
        {
            Fl_Group *pG  = MakeCommunityPane(10,30,800,390,(char*)sName.c_str());
            CScopeTabPane * pTabPane = (CScopeTabPane*)(pG);
            pTabPane->SetMOOSInfo(sHost,nPort);
            Fl_Group::current()->resizable(pG);
        }
    }
    if(pTab->children()==0)
    {
        MakeCommunityPane(10,30,800,390,"Unnamed");
    }
    
    w->end();
    
    
    //and add some buttons to control them....
    w->begin();
    {
        //add
        Fl_Button * pNewCommunityButton = new Fl_Button(10,420,160,30,"Add Community");
        pNewCommunityButton->callback(OnAddCommunity,pTab);
        
        //delete
        Fl_Button * pDelCommunityButton = new Fl_Button(180,420,160,30,"Remove Community");
        pDelCommunityButton->callback(OnRemoveCommunity,pTab);
        
        //save
        Fl_Button * pSaveButton = new Fl_Button(350,420,160,30,"Save Layout");
        pSaveButton->callback(OnSave,pTab);
        pSaveButton->callback();
        
        //rename
        Fl_Button * pRenameButton = new Fl_Button(520,420,160,30,"Rename");
        pRenameButton->callback(OnRenameCommunity,pTab);
        pRenameButton->callback();
        
    }
    w->end();
    
    
    //need to do more work on resizing       - maybe even read the manual
    w->resizable(pTab);
    
    
    //and GO!
    w->show(argc, argv);
    return Fl::run();
    
}