2 #include <Gui/StringConv.hh>
12 pthread_mutex_init(&guiMutex_,NULL);
13 if(pthread_create(&guiThread_, NULL,
15 BIASERR(
"Could not create gui thread");
25 pthread_cancel(guiThread_);
33 pthread_setcancelstate(PTHREAD_CANCEL_ENABLE,&oldstate);
36 wxApp::SetInstance(caller->
app_);
37 int i=0; wxChar **c=NULL;
47 pthread_mutex_lock(&guiMutex_);
48 app_->SetTitle(Title);
49 pthread_mutex_unlock(&guiMutex_);
55 pthread_mutex_lock(&guiMutex_);
56 app_->ShowConvertedImage(image);
57 pthread_mutex_unlock(&guiMutex_);
75 if(frame_!=NULL) frame_->SetTitle(Title);
83 return frame_->ShowConvertedImage(image);
90 const wxPoint pos,
const wxSize size)
91 : wxFrame((wxFrame *)NULL, -1, title, pos, size)
94 panel_ =
new wxPanel(
this);
99 wxSizer *pSizer =
new wxBoxSizer( wxHORIZONTAL );
102 ic_->SetSize(1024,768);
103 pSizer->Add(
panel_,1, wxEXPAND |wxALL , 5);
116 wxTopLevelWindow::SetTitle(t);
132 int KeyBuffer_ =
event.GetKeyCode();
133 cout<<
"Key:"<<KeyBuffer_<<endl;
138 OnQuit(wxCommandEvent& WXUNUSED(event))
virtual void OnQuit(wxCommandEvent &event)
class BIASGui_EXPORT GuiWXFrame
virtual void SetTitle(std::string const &Title)
virtual int ShowConvertedImage_(BIAS::Image< unsigned char > &image)
Does the real update of the image shown in window. Must be overloaded.
wxString AsciiToWx(const char *thestring)
Converts a C string to a wxString.
simple wxWindow to display an image.
class BIASGui_EXPORT GuiWXApp
void SetTitle(std::string const &Title)
BIAS::Image< unsigned char > image_
virtual void SetTitle(std::string const &Title)
int ShowConvertedImage(BIAS::Image< unsigned char > &image)
Image canvas that does not show zoom frames and redirects mouse click events to its parent...
virtual int ShowConvertedImage(BIAS::Image< unsigned char > &image)
virtual void OnKeyDown(wxKeyEvent &event)
virtual void OnTimer(wxTimerEvent &event)
static void * guiThreadFunc_(GuiWX *caller)
virtual void Show(BIAS::Image< unsigned char > &im, std::string name="")
GuiWXFrame(const wxString title=wxT(""), const wxPoint pos=wxDefaultPosition, const wxSize size=wxDefaultSize)
BIAS::PlainImageCanvas * ic_