本文整理汇总了C++中AppWindow类的典型用法代码示例。如果您正苦于以下问题:C++ AppWindow类的具体用法?C++ AppWindow怎么用?C++ AppWindow使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AppWindow类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HoverUI
/// UI which the mouse is currently hovering over, which may be any AppWindow.
UserInterface * HoverUI()
{
AppWindow * hoverWindow = WindowMan.HoverWindow();
if (!hoverWindow)
return NULL;
return hoverWindow->GetUI();
}
示例2: main
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
AppWindow window;
window.show();
return app.exec();
}
示例3: GlobalUI
/// Fetches the global UI, taking into consideration active AppWindow.
UserInterface * GlobalUI()
{
AppWindow * activeWindow = WindowMan.GetCurrentlyActiveWindow();
if (!activeWindow)
return NULL;
return activeWindow->GetGlobalUI();
}
示例4: main
int main(int argc, char** argv)
{
// Construct our main loop
Gtk::Main kit(argc, argv);
// Initialize OpenGL
Gtk::GL::init(argc, argv);
std::string filename = "puppet.lua";
if (argc >= 2) {
filename = argv[1];
}
// This is how you might import a scene.
SceneNode* root = import_lua(filename);
if (!root) {
std::cerr << "Could not open " << filename << std::endl;
return 1;
}
// Construct our (only) window
AppWindow window;
// Set the root node for the viewer
window.getViewer().setSceneRoot(root);
// And run the application!
Gtk::Main::run(window);
}
示例5: main
int main(int argc, char** argv)
{
// Construct our main loop
Gtk::Main kit(argc, argv);
// Initialize OpenGL
Gtk::GL::init(argc, argv);
std::string filename = "../lua_scripts/pieces.lua";
if (argc >= 2) {
filename = argv[1];
}
// This is how you might import a scene.
//SceneNode* root = import_lua(filename);
// if (!root) {
// std::cerr << "Could not open " << filename << std::endl;
// return 1;
// }
// Construct our (only) window
AppWindow window;
window.set_filename(filename);
// And run the application!
Gtk::Main::run(window);
}
示例6: main
int main(int argc, char **argv) {
AppWindow* win = new AppWindow(215, 144);
win->begin();
MenuBar* o = new MenuBar(0, 0, 215, 25);
o->menu(menu_);
Fl_Image* img1 = (Fl_Image*)IconLoader::get("document-new", ICON_SIZE_TINY);
Fl_Image* img2 = (Fl_Image*)IconLoader::get("document-save", ICON_SIZE_SMALL);
Fl_Image* img3 = (Fl_Image*)IconLoader::get("system-log-out", ICON_SIZE_TINY);
menu_[1].image(img1);
menu_[1].tooltip("Tooltip for First Item");
menu_[2].image(img2);
menu_[8].image(img3);
MenuButton* b = new MenuButton(65, 80, 90, 25, "menu");
b->menu(menu_menu);
Fl_Image* img4 = (Fl_Image*)IconLoader::get("folder", ICON_SIZE_TINY);
menu_menu[0].image(img4);
menu_menu[0].tooltip("This should be some folder");
win->end();
win->show(argc, argv);
return Fl::run();
}
示例7: ActiveUI
/// Fetches active/current UI, taking into consideration active AppWindow.
UserInterface * ActiveUI()
{
AppWindow * activeWindow = WindowMan.GetCurrentlyActiveWindow();
if (!activeWindow)
{
LogMain("ActiveUI(): No active AppWindow!", WARNING);
return NULL;
}
return activeWindow->GetUI();
}
示例8: sender
void Albums::showAlbumFromObjectMenu()
{
// Since we are dealing with a slot triggered by
// an objectmenu action, then find the res string
// by looking in the parent of the sender
QString res = sender()->parent()->objectName();
AppWindow *window = AppWindow::instance();
window->showAlbum(res);
}
示例9: MainUI
UserInterface * MainUI()
{
AppWindow * mainWindow = MainWindow();
if (!mainWindow)
{
LogMain("MainUI(): No main AppWindow!", WARNING);
return NULL;
}
return mainWindow->GetUI();
}
示例10: RelevantUI
/// Fetches either the Global or Active UI, taking into consideration both active AppWindow and if there exist any valid content in the Global UI.
UserInterface * RelevantUI()
{
AppWindow * window = WindowMan.GetCurrentlyActiveWindow();
if (!window)
return NULL;
UserInterface * globalUI = window->GetGlobalUI();
if (globalUI && globalUI->HasActivatableElement())
return globalUI;
return window->GetUI();
}
示例11: main
//==========================================================================
// Main routine
//==========================================================================
int main ( int argc, char** argv )
{
// Init freeglut library:
glutInit ( &argc,argv );
glutInitDisplayMode ( GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH );
// Now create the window of your application:
AppWindow* w = new AppWindow ( "CSE165 Mini-Project", 300, 300, 640, 480 );
// Finally start the main loop:
w->run ();
}
示例12: main
//==============================================================================
// main - this is the main module for our application. It handle the
// initialization of the window, going into a message loop for
// dispatching messages and terminates the window upon successful exit
// from the message loop
//==============================================================================
void cdecl main( void ) {
// initialize the main instance of our application
if (Main::Initialize()==FALSE)
APIError((HWND)NULL,(HWND)NULL);
{
AppWindow MainWnd; // initialize our application window
Main::FramehWnd = MainWnd.GetFrameHandle();
Main::MessageLoop(); // call our message handler for our app
}
Main::Terminate(); // terminate the application
}
示例13: _runUI
int _runUI(int argc, char *argv[])
{
QApplication a(argc, argv);
ProductRepository<Product*>* repo = new ProductRepository<Product*>("produse.txt", "cantitati.txt");
Inventory* ctrl = new Inventory(repo);
AppWindow* GUI = new AppWindow(ctrl);
//GUI->setMinimumSize(2048, 1024);
GUI->show();
return a.exec();
}
示例14: eventWindowProperty
/**
* Triggered when window has moved or resized (handled internally by an event)
*
* @param *window - reference to the window object
* @param *event - event object returned by GDK layer
* @param parent - the owner of this callback
*
* @return always false
*/
bool AppWindow::eventWindowProperty(GtkWindow *window, GdkEventConfigure* event, AppWindow& parent) {
if (parent.posEventFirstPass) {
// Get original coords
Geometry geom = parent.getConfig()->getWindowGeom();
// Correct the position on first pass
gtk_window_move(window, geom.getLeft(), geom.getTop());
parent.posEventFirstPass = false;
}
// Retrieve the new window size
ConfigContainer *config = parent.getConfig();
Geometry geom(event->x, event->y, event->width, event->height);
config->setWindowGeom(geom);
// Always return false, otherwise the event may not trigger properly (GTK will cancel, but Xorg will honour it)
return false;
}
示例15: main
//==========================================================================
// Main routine
//==========================================================================
int main ( int argc, char** argv )
{
// Init random number generator
srand(time(NULL));
// Init freeglut library:
glutInit ( &argc,argv );
glutInitDisplayMode ( GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH );
// Now create the window of your application:
AppWindow* w = new AppWindow ( "CSE165 Support Code", 300, 300, 640, 480 );
// Finally start the main loop:
w->run ();
}