Hugin trunk 0.1
Loading...
Searching...
No Matches
PTWXDlg.cpp
Go to the documentation of this file.
1// -*- c-basic-offset: 4 -*-
2
27#include "hugin_config.h"
28#include "panoinc_WX.h"
29#include "panoinc.h"
30#include "PTWXDlg.h"
31#include <wx/app.h>
32#include "wxutils.h"
33
34extern "C" {
35#include <pano13/filter.h>
36#include <pano13/queryfeature.h>
37}
38
39// Error reporting
40
41static void PTPrintErrorWX(char* fmt, va_list ap)
42{
43 char message[257];
44
46
47// MessageBox(GetFocus(), (LPSTR)message, (LPSTR)"", MB_OK | MB_ICONHAND) ;
49}
50
51#ifdef __WXMSW__
53#else
54typedef wxProgressDialog PTProgressDialog;
55#endif
56// Progress report; return false if canceled
57
58
59static int PTProgressWX( int command, char* argument ){
60
61 static PTProgressDialog* dlg = 0;
62// MSG msg;
63 long percent;
64 switch( command ){
65 case _initProgress:
66 if (dlg) {
67 dlg->Destroy();
68 wxTheApp->Yield();
69 dlg = 0;
70 } else {
71 dlg = new PTProgressDialog(_("Panorama Tools"),
72 "\n\n\n", 100, wxGetActiveWindow(),
74 if (dlg == 0) {
75 return FALSE;
76 }
77 dlg->Update(0, wxString(argument, wxConvLocal));
78 }
79 return TRUE;
80 case _setProgress:
81 if (dlg) {
82 sscanf(argument,"%ld", &percent);
83 if(percent>100) percent = 100;
84 if(percent<0 ) percent = 0;
85 if (! dlg->Update(percent)) {
86 return FALSE;
87 }
88 }
89 return TRUE;
90 break;
92 if( dlg != 0 )
93 {
94 dlg->Destroy();
95 wxTheApp->Yield();
96 dlg=0;
97 }
98
99 return TRUE;
100
101 case _idleProgress:
102 return TRUE;
103
104 }
105 return TRUE;
106}
107
108
109static int PTInfoDlgWX ( int command, char* argument ) // Display info: same argumenmts as progress
110{
111 char text[256];
112 static char mainMessage[256];
113
114 static PTProgressDialog* dlg = 0;
115// MSG msg;
116 switch( command ){
117 case _initProgress:
118 if (dlg) {
119 dlg->Destroy();
120 wxTheApp->Yield();
121 dlg = 0;
122 } else {
123 // we need to ensure that there is are enough lines in the dialog..
124 // create progress dialog
125 dlg = new PTProgressDialog(_("Panorama Tools"),
127 "0123456789012345678901234567890123456789012345\n\n\n\n\n",
128#else
129 "0123456789012345678901234567890123456789012345\n\n\n",
130#endif
131 100, wxGetActiveWindow(),
133 if (dlg == 0) {
134 return FALSE;
135 }
137 }
138 return TRUE;
139 case _setProgress:
140 if (dlg) {
141 if( *argument != 0 )
142 {
143 bool cont;
144
145 if( *argument != '+' )
146 {
148 strcpy( text, argument );
149 }
150 else
151 {
152 sprintf( text,"%s%s", mainMessage, &(argument[1]) );
153 }
155 if (! cont) {
156 return FALSE;
157 }
158 }
159 }
160 return TRUE;
161 break;
162 case _disposeProgress:
163 if( dlg != 0 )
164 {
165 dlg->Destroy();
166 wxTheApp->Yield();
167 dlg=0;
168 }
169
170 return TRUE;
171
172 case _idleProgress:
173 return TRUE;
174 }
175 return TRUE;
176}
177
184
191
static int PTProgressWX(int command, char *argument)
Definition PTWXDlg.cpp:59
static int PTInfoDlgWX(int command, char *argument)
Definition PTWXDlg.cpp:109
wxProgressDialog PTProgressDialog
Definition PTWXDlg.cpp:54
void registerPTWXDlgFcn()
Definition PTWXDlg.cpp:178
void deregisterPTWXDlgFcn()
Definition PTWXDlg.cpp:185
static void PTPrintErrorWX(char *fmt, va_list ap)
Definition PTWXDlg.cpp:41
int HuginMessageBox(const wxString &message, const wxString &caption, int style, wxWindow *parent)
Definition wxutils.cpp:176
include file for the hugin project
include file for the hugin project
std::vector< deghosting::BImagePtr > threshold(const std::vector< deghosting::FImagePtr > &inputImages, const double threshold, const uint16_t flags)
Threshold function used for creating alpha masks for images.
Definition threshold.h:41