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 // User calls this to create or raise the dialog box. 00023 void start(); 00024 void run(); 00025 00026 // After the window is closed, this is called 00027 virtual void handle_done_event(int result); 00028 00029 // After the window is closed and deleted, this is called. 00030 virtual void handle_close_event(int result); 00031 00032 // User creates the window and initializes it here. 00033 virtual BC_Window* new_gui(); 00034 BC_Window* get_gui(); 00035 00036 // Called by user to access the gui pointer 00037 void lock_window(char *location); 00038 void unlock_window(); 00039 00040 private: 00041 BC_Window *gui; 00042 Condition *startup_lock; 00043 Mutex *window_lock; 00044 }; 00045 00046 00047 00048 00049 00050 00051 00052 00053 #endif
1.5.5