本文整理汇总了C++中Fl_Double_Window::callback方法的典型用法代码示例。如果您正苦于以下问题:C++ Fl_Double_Window::callback方法的具体用法?C++ Fl_Double_Window::callback怎么用?C++ Fl_Double_Window::callback使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fl_Double_Window
的用法示例。
在下文中一共展示了Fl_Double_Window::callback方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Execute
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;
}
示例2: ShowModsGUI
void ShowModsGUI() {
Fl_Double_Window* wind = make_mods_window();
wind->callback([](Fl_Widget* window) {
if(visible_callback) {
visible_callback(false);
}
if(window) {
delete (Fl_Double_Window*)window;
mods_window = nullptr;
}
if(appended_ai_tree) {
Fl_Tree_Item* first = appended_ai_tree->first();
if(first) {
for(int i = 0; i < first->children(); i++) {
delete (int*)(first->child(i)->user_data());
}
}
appended_ai_tree = nullptr;
}
});
wind->show();
visible_callback(true);
}
示例3: ModelerView
ModelerUserInterface::ModelerUserInterface() {
Fl_Double_Window* w;
{ Fl_Double_Window* o = m_controlsWindow = new Fl_Double_Window(395, 325, "Final Project Controls");
w = o;
o->callback((Fl_Callback*)cb_m_controlsWindow, (void*)(this));
o->when(FL_WHEN_NEVER);
{ Fl_Menu_Bar* o = m_controlsMenuBar = new Fl_Menu_Bar(0, 0, 395, 25);
o->menu(menu_m_controlsMenuBar);
}
{ Fl_Browser* o = m_controlsBrowser = new Fl_Browser(0, 25, 140, 300, "Controls");
o->type(3);
o->textsize(10);
o->callback((Fl_Callback*)cb_m_controlsBrowser);
Fl_Group::current()->resizable(o);
}
{ Fl_Scroll* o = m_controlsScroll = new Fl_Scroll(145, 25, 250, 300);
o->type(6);
o->when(FL_WHEN_CHANGED);
{ Fl_Pack* o = m_controlsPack = new Fl_Pack(145, 25, 225, 300);
o->end();
}
o->end();
}
o->end();
}
{ Fl_Double_Window* o = m_modelerWindow = new Fl_Double_Window( 800, 800, "Assignment 2 Model");
w = o;
o->callback((Fl_Callback*)cb_m_modelerWindow, (void*)(this));
o->when(FL_WHEN_NEVER);
{ ModelerView* o = m_modelerView = new ModelerView(0, 0, 800, 800, "ModelerView");
o->box(FL_NO_BOX);
o->color(FL_BACKGROUND_COLOR);
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);
Fl_Group::current()->resizable(o);
}
o->end();
}
}
示例4: Fl_Scroll
ModelerUserInterface::ModelerUserInterface() {
// Make this instance the current one
instance = this;
// Initialize pointers to NULL
m_nativeChooser = NULL;
model = NULL;
currentGroup = NULL;
// Set appearance to GTK+ for a nice look
Fl::scheme("gtk+");
// Set the animation speed to 24 frames/second
framesPerSecond = 24;
// We're not animating yet.
animating = false;
// Set the color scheme
Fl::set_color(FL_BACKGROUND_COLOR, 240, 240, 240);
Fl::set_color(FL_BACKGROUND2_COLOR, 255, 255, 255);
Fl::set_color(FL_FOREGROUND_COLOR, 0, 0, 0);
Fl::set_color(FL_INACTIVE_COLOR, 128, 128, 128);
Fl::set_color(FL_SELECTION_COLOR, 51, 153, 255);
// Create all of the UI elements
// (autogenerated by FLUID, the FLTK UI Designer)
Fl_Double_Window* w;
//const char* title = "CSEP457 Modeler";
const char* title = "CSEP557 Modeler";
{ Fl_Double_Window* o = m_controlsWindow = new Fl_Double_Window(800, 625, title);
w = o;
o->callback((Fl_Callback*)cb_m_controlsWindow, (void*)(this));
o->when(FL_WHEN_NEVER);
{ Fl_Menu_Bar* o = m_controlsMenuBar = new Fl_Menu_Bar(0, 0, 800, 25);
o->menu(menu_m_controlsMenuBar);
}
// Contains the controls on the left
{ leftPane = new Fl_Group(0, 25, 250, 600);
int tabSpace = -25, controlSpace = 0;
{ Fl_Tile* o = m_controlSplitPane = new Fl_Tile(0, 50 + tabSpace, 250, 575 - tabSpace);
o->box(FL_FLAT_BOX);
{ Fl_Tree* o = m_controlsTree = new Fl_Tree(0, 50 + tabSpace, 250, 100);
o->when(FL_WHEN_CHANGED);
o->callback((Fl_Callback*)TreeCallback);
o->marginleft(-5);
o->end();
}
{ Fl_Scroll* o = m_controlsScroll =
new Fl_Scroll(0, 150 + tabSpace, 250, 475 - tabSpace - controlSpace);
o->type(Fl_Scroll::VERTICAL);
o->when(FL_WHEN_CHANGED);
{ Fl_Pack* o = m_controlsPack =
new Fl_Pack(10, 150 + tabSpace, 215, 475 - tabSpace - controlSpace);
Fl_Group::current()->resizable(o);
o->spacing(2);
o->end();
}
o->end();
}
o->end();
} // end Modeler group/tab
leftPane->end();
} // left pane
{ // TODO: remove this extra brace!
{ Fl_Group* o = m_viewPane = new Fl_Group(250, 25, 550, 600);
o->box(FL_NO_BOX);
o->color(FL_BACKGROUND_COLOR);
m_modelerView = new ModelerView(250, 25, 550, 600, "");
w->resizable(m_modelerView);
o->end();
Fl_Group::current()->resizable(o);
}
}
o->end();
}
}
示例5: thread
//.........这里部分代码省略.........
no_ui = true;
free( name );
}
if ( ! no_ui )
{
Fl::visual( FL_DOUBLE | FL_RGB );
Fl::visible_focus( 0 );
fl_register_images();
}
Fl::lock();
Fl_Double_Window *main_window;
{
Fl_Double_Window *o = main_window = new Fl_Double_Window( 800, 600, "Non Mixer" );
{
main_window->xclass( APP_NAME );
{
Fl_Widget *o = mixer = new Mixer( 0, 0, main_window->w(), main_window->h(), NULL );
Fl_Group::current()->resizable(o);
}
}
o->end();
o->size_range( main_window->w(), mixer->min_h(), 0, 0 );
o->callback( (Fl_Callback*)cb_main, main_window );
if ( ! no_ui )
{
o->show( 0,0 );
}
}
Plugin_Module::spawn_discover_thread();
mixer->init_osc( osc_port );
char *nsm_url = getenv( "NSM_URL" );
if ( nsm_url )
{
if ( ! nsm->init( nsm_url ) )
{
if ( instance_override )
WARNING( "--instance option is not available when running under session management, ignoring." );
if ( optind < argc )
WARNING( "Loading files from the command-line is incompatible with session management, ignoring." );
nsm->announce( APP_NAME, ":switch:dirty:", argv[0] );
/* if ( ! no_ui ) */
/* { */
// poll so we can keep OSC handlers running in the GUI thread and avoid extra sync
Fl::add_timeout( NSM_CHECK_INTERVAL, check_nsm, NULL );
/* } */
}
示例6: Fl_Tile
ModelerUserInterface::ModelerUserInterface() {
// Make this instance the current one
instance = this;
// Initialize pointers to NULL
m_nativeChooser = NULL;
model = NULL;
currentGroup = NULL;
renderGroup = NULL;
defaultCam = NULL;
ps = NULL;
movieWidth = 720;
movieHeight = 480;
// Set appearance to GTK+ for a nice look
Fl::scheme("gtk+");
// Set the animation speed to 24 frames/second
framesPerSecond = 24;
// We're not animating yet.
animating = false;
simulating = false;
rendering = false;
drawing = false;
// Set the color scheme
Fl::set_color(FL_BACKGROUND_COLOR, 240, 240, 240);
Fl::set_color(FL_BACKGROUND2_COLOR, 255, 255, 255);
Fl::set_color(FL_FOREGROUND_COLOR, 0, 0, 0);
Fl::set_color(FL_INACTIVE_COLOR, 128, 128, 128);
Fl::set_color(FL_SELECTION_COLOR, 51, 153, 255);
// Create all of the UI elements
// (autogenerated by FLUID, the FLTK UI Designer)
Fl_Double_Window* w;
const char* title = "Animator";
{ Fl_Double_Window* o = m_controlsWindow = new Fl_Double_Window(800, 625, title);
w = o;
o->callback((Fl_Callback*)cb_m_controlsWindow, (void*)(this));
o->when(FL_WHEN_NEVER);
{ Fl_Menu_Bar* o = m_controlsMenuBar = new Fl_Menu_Bar(0, 0, 800, 25);
o->menu(menu_m_controlsMenuBar);
}
// Contains the controls on the left
{ leftPane = new Fl_Group(0, 25, 250, 600);
int tabSpace = 0, controlSpace = 0;
int controlTop = 25 + 600 - controlSpace;
// Modeler and Curves tabs
{ Fl_Tabs* t = new Fl_Tabs(0, 25, 250, 600 - controlSpace);
// Make the tab area stretch.
leftPane->resizable(t);
t->when(FL_WHEN_CHANGED);
t->callback((Fl_Callback*)TabsCallback, this);
// Curves tab
{ Fl_Group* o = new Fl_Group(0, 50, 250, 575 - controlSpace, "Curves");
o->box(FL_FLAT_BOX);
o->color(FL_BACKGROUND_COLOR);
{ Fl_Tree* o = curvesTree = new Fl_Tree(0, 50, 250, 575 - controlSpace);
o->when(FL_WHEN_CHANGED);
o->callback((Fl_Callback*)CurveTreeCallback);
o->marginleft(-5);
o->end();
}
o->end();
}
// Modeler tab
{ Fl_Tile* o = m_controlSplitPane =
new Fl_Tile(0, 50 + tabSpace, 250, 575 + tabSpace - controlSpace, "Modeler");
// Make only the content area of the tabs resize.
t->resizable(o);
o->box(FL_FLAT_BOX);
{ Fl_Tree* o = m_controlsTree = new Fl_Tree(0, 50 + tabSpace, 250, 100);
o->when(FL_WHEN_CHANGED);
o->callback((Fl_Callback*)TreeCallback);
o->marginleft(-5);
o->end();
}
{ Fl_Scroll* o = m_controlsScroll =
new Fl_Scroll(0, 150 + tabSpace, 250, 475 - tabSpace - controlSpace);
o->type(Fl_Scroll::VERTICAL);
o->when(FL_WHEN_CHANGED);
{ Fl_Pack* o = m_controlsPack =
new Fl_Pack(10, 150 + tabSpace, 215, 475 - tabSpace - controlSpace);
Fl_Group::current()->resizable(o);
o->spacing(2);
o->end();
}
o->end();
}
o->end();
} // end Modeler group/tab
t->end();
} // end tabs
leftPane->end();
} // left pane
{ // TODO: remove this extra brace!
//.........这里部分代码省略.........