00001 #ifndef BCDIALOG_H 00002 #define BCDIALOG_H 00003 00004 #include "bcdialog.inc" 00005 #include "condition.inc" 00006 #include "guicast.h" 00007 #include "mutex.inc" 00008 #include "thread.h" 00009 00010 00011 // Generic dialog box with static thread and proper locking. 00012 // Create the thread object at startup. Call start() to do the dialog. 00013 // Only one dialog instance is allowed at a time. These must be overridden 00014 // to add functionality. 00015 00016 class BC_DialogThread : public Thread 00017 { 00018 public: 00019 BC_DialogThread(); 00020 virtual ~BC_DialogThread(); 00021 00022 void start(); 00023 void run(); 00024 00025 // After the window is closed, this is called 00026 virtual void handle_done_event(int result); 00027 00028 // After the window is closed and deleted, this is called. 00029 virtual void handle_close_event(int result); 00030 00031 // User creates the window and initializes it here. 00032 virtual BC_Window* new_gui(); 00033 BC_Window* get_gui(); 00034 00035 private: 00036 BC_Window *gui; 00037 Condition *startup_lock; 00038 Mutex *window_lock; 00039 }; 00040 00041 00042 00043 00044 00045 00046 00047 00048 #endif
1.4.4