#include "wx/button.h"
#include "wx/bmpbuttn.h"
#include "wx/radiobox.h"
-#include "wx/radiobut.h"
#include "wx/listbox.h"
#include "wx/choice.h"
#include "wx/checkbox.h"
#include "wx/settings.h"
#include "wx/slider.h"
+#include "wx/icon.h"
#include "wx/statbox.h"
#include "wx/statbmp.h"
-#if wxUSE_GAUGE
#include "wx/gauge.h"
-#endif
#include "wx/textctrl.h"
#include "wx/msgdlg.h"
#include "wx/intl.h"
#endif
-#if wxUSE_RADIOBUTTON
+#if wxUSE_RADIOBTN
#include "wx/radiobut.h"
#endif
((wxGauge *)control)->SetValue((int)childResource->GetValue1());
}
#endif
-#if wxUSE_RADIOBUTTON
+#if wxUSE_RADIOBTN
else if (itemType == wxString(_T("wxRadioButton")))
{
control = new wxRadioButton(parent, id, childResource->GetTitle(), // (int)childResource->GetValue1(),
}
dialogItem->SetStyle(windowStyle);
dialogItem->SetValue1(isModal);
+ if (windowStyle & wxDIALOG_MODAL) // Uses style in wxWin 2
+ dialogItem->SetValue1(TRUE);
+
dialogItem->SetName(name);
dialogItem->SetTitle(title);
dialogItem->SetSize(x, y, width, height);
wxString str(expr->Nth(count)->StringValue());
count ++;
- if (str != "")
+ if (str != _T(""))
{
controlItem->SetValue4(str);
controlItem->SetType(_T("wxBitmapButton"));
controlItem->SetFont(wxResourceInterpretFontSpec(expr->Nth(count)));
}
}
-#if wxUSE_RADIOBUTTON
+#if wxUSE_RADIOBTN
else if (controlType == _T("wxRadioButton"))
{
// Check for default value
static bool wxEatWhiteSpace(FILE *fd)
{
- int ch = getc(fd);
- if ((ch != ' ') && (ch != '/') && (ch != ' ') && (ch != 10) && (ch != 13) && (ch != 9))
- {
- ungetc(ch, fd);
- return TRUE;
- }
+ int ch = 0;
- // Eat whitespace
- while (ch == ' ' || ch == 10 || ch == 13 || ch == 9)
- ch = getc(fd);
- // Check for comment
- if (ch == '/')
- {
- ch = getc(fd);
- if (ch == '*')
- {
- bool finished = FALSE;
- while (!finished)
+ while ((ch = getc(fd)) != EOF)
{
- ch = getc(fd);
- if (ch == EOF)
- return FALSE;
- if (ch == '*')
- {
- int newCh = getc(fd);
- if (newCh == '/')
- finished = TRUE;
- else
- {
- ungetc(newCh, fd);
- }
- }
+ switch (ch)
+ {
+ case ' ':
+ case 0x0a:
+ case 0x0d:
+ case 0x09:
+ break;
+ case '/':
+ {
+ int prev_ch = ch;
+ ch = getc(fd);
+ if (ch == EOF)
+ {
+ ungetc(prev_ch, fd);
+ return TRUE;
+ }
+
+ if (ch == '*')
+ {
+ // Eat C comment
+ prev_ch = 0;
+ while ((ch = getc(fd)) != EOF)
+ {
+ if (ch == '/' && prev_ch == '*')
+ break;
+ prev_ch = ch;
+ }
+ }
+ else if (ch == '/')
+ {
+ // Eat C++ comment
+ static char buffer[255];
+ fgets(buffer, 255, fd);
+ }
+ else
+ {
+ ungetc(prev_ch, fd);
+ ungetc(ch, fd);
+ return TRUE;
+ }
+ }
+ break;
+ default:
+ ungetc(ch, fd);
+ return TRUE;
+
+ }
}
- }
- else // False alarm
- return FALSE;
- }
- else
- ungetc(ch, fd);
- return wxEatWhiteSpace(fd);
+ return FALSE;
}
bool wxGetResourceToken(FILE *fd)
if (strcmp(wxResourceBuffer, "#define") == 0)
{
wxGetResourceToken(fd);
- wxChar *name = copystring(wxConv_libc.cMB2WX(wxResourceBuffer));
+ wxChar *name = copystring(wxConvCurrent->cMB2WX(wxResourceBuffer));
wxGetResourceToken(fd);
- wxChar *value = copystring(wxConv_libc.cMB2WX(wxResourceBuffer));
+ wxChar *value = copystring(wxConvCurrent->cMB2WX(wxResourceBuffer));
if (wxIsalpha(value[0]))
{
int val = (int)wxAtol(value);
else if (strcmp(wxResourceBuffer, "#include") == 0)
{
wxGetResourceToken(fd);
- wxChar *name = copystring(wxConv_libc.cMB2WX(wxResourceBuffer));
+ wxChar *name = copystring(wxConvCurrent->cMB2WX(wxResourceBuffer));
wxChar *actualName = name;
if (name[0] == _T('"'))
actualName = name + 1;
{
wxChar buf[300];
wxStrcpy(buf, _("Found "));
- wxStrncat(buf, wxConv_libc.cMB2WX(wxResourceBuffer), 30);
+ wxStrncat(buf, wxConvCurrent->cMB2WX(wxResourceBuffer), 30);
wxStrcat(buf, _(", expected static, #include or #define\nwhilst parsing resource."));
wxLogWarning(buf);
return FALSE;
{ _T("wxTB_VERTICAL"), wxTB_VERTICAL},
{ _T("wxTB_FLAT"), wxTB_FLAT},
+ /* wxDialog */
+ { _T("wxDIALOG_MODAL"), wxDIALOG_MODAL },
+
/* Generic */
{ _T("wxVSCROLL"), wxVSCROLL },
{ _T("wxHSCROLL"), wxHSCROLL },
wxItemResource *item = table->FindResource(resource);
if (item)
{
- if ((item->GetType() == "") || (item->GetType() != "wxBitmap"))
+ if ((item->GetType() == _T("")) || (item->GetType() != _T("wxBitmap")))
{
wxLogWarning(_("%s not a bitmap resource specification."), (const wxChar*) resource);
return wxNullBitmap;
if (strcmp(wxResourceBuffer, "#define") == 0)
{
wxGetResourceToken(fd);
- wxChar *name = copystring(wxConv_libc.cMB2WX(wxResourceBuffer));
+ wxChar *name = copystring(wxConvCurrent->cMB2WX(wxResourceBuffer));
wxGetResourceToken(fd);
- wxChar *value = copystring(wxConv_libc.cMB2WX(wxResourceBuffer));
+ wxChar *value = copystring(wxConvCurrent->cMB2WX(wxResourceBuffer));
if (wxIsdigit(value[0]))
{
int val = (int)wxAtol(value);
bool wxEatWhiteSpaceString(char *s)
{
- int ch = getc_string(s);
- if (ch == EOF)
- return TRUE;
-
- if ((ch != ' ') && (ch != '/') && (ch != ' ') && (ch != 10) && (ch != 13) && (ch != 9))
- {
- ungetc_string();
- return TRUE;
- }
+ int ch = 0;
- // Eat whitespace
- while (ch == ' ' || ch == 10 || ch == 13 || ch == 9)
- ch = getc_string(s);
- // Check for comment
- if (ch == '/')
- {
- ch = getc_string(s);
- if (ch == '*')
- {
- bool finished = FALSE;
- while (!finished)
+ while ((ch = getc_string(s)) != EOF)
{
- ch = getc_string(s);
- if (ch == EOF)
- return FALSE;
- if (ch == '*')
- {
- int newCh = getc_string(s);
- if (newCh == '/')
- finished = TRUE;
- else
- {
+ switch (ch)
+ {
+ case ' ':
+ case 0x0a:
+ case 0x0d:
+ case 0x09:
+ break;
+ case '/':
+ {
+ int prev_ch = ch;
+ ch = getc_string(s);
+ if (ch == EOF)
+ {
+ ungetc_string();
+ return TRUE;
+ }
+
+ if (ch == '*')
+ {
+ // Eat C comment
+ prev_ch = 0;
+ while ((ch = getc_string(s)) != EOF)
+ {
+ if (ch == '/' && prev_ch == '*')
+ break;
+ prev_ch = ch;
+ }
+ }
+ else
+ {
+ ungetc_string();
+ ungetc_string();
+ return TRUE;
+ }
+ }
+ break;
+ default:
ungetc_string();
- }
- }
+ return TRUE;
+
+ }
}
- }
- else // False alarm
- return FALSE;
- }
- else if (ch != EOF)
- ungetc_string();
- return wxEatWhiteSpaceString(s);
+ return FALSE;
}
bool wxGetResourceTokenString(char *s)
if (strcmp(wxResourceBuffer, "#define") == 0)
{
wxGetResourceTokenString(s);
- wxChar *name = copystring(wxConv_libc.cMB2WX(wxResourceBuffer));
+ wxChar *name = copystring(wxConvCurrent->cMB2WX(wxResourceBuffer));
wxGetResourceTokenString(s);
- wxChar *value = copystring(wxConv_libc.cMB2WX(wxResourceBuffer));
+ wxChar *value = copystring(wxConvCurrent->cMB2WX(wxResourceBuffer));
if (wxIsalpha(value[0]))
{
int val = (int)wxAtol(value);
{
wxChar buf[300];
wxStrcpy(buf, _("Found "));
- wxStrncat(buf, wxConv_libc.cMB2WX(wxResourceBuffer), 30);
+ wxStrncat(buf, wxConvCurrent->cMB2WX(wxResourceBuffer), 30);
wxStrcat(buf, _(", expected static, #include or #define\nwhilst parsing resource."));
wxLogWarning(buf);
return FALSE;
* resource loading facility
*/
-bool wxWindow::LoadFromResource(wxWindow *parent, const wxString& resourceName, const wxResourceTable *table)
+bool wxWindowBase::LoadFromResource(wxWindow *parent, const wxString& resourceName, const wxResourceTable *table)
{
if (!table)
table = wxDefaultResourceTable;
}
else
{
- if (!this->Create(parent, -1, wxPoint(x, y), wxSize(width, height), theWindowStyle, name))
+ if (!((wxWindow *)this)->Create(parent, -1, wxPoint(x, y), wxSize(width, height), theWindowStyle, name))
return FALSE;
}
return TRUE;
}
-wxControl *wxWindow::CreateItem(const wxItemResource *resource, const wxItemResource* parentResource, const wxResourceTable *table)
+wxControl *wxWindowBase::CreateItem(const wxItemResource *resource, const wxItemResource* parentResource, const wxResourceTable *table)
{
if (!table)
table = wxDefaultResourceTable;