/* wxWindows version (not used but required by autoheader) */
/* ------------------------------------------------------------------------ */
-#if 0
-#undef PACKAGE
-#undef VERSION
-#endif
-
/* needed for older automake? */
#undef WITH_SYMBOL_UNDERSCORE
@BOTTOM@
+#undef PACKAGE
+#undef VERSION
+
#endif /* __GTKSETUPH__ */
#endif
#include "wx/defs.h"
+
+#if wxUSE_ACCEL
+
#include "wx/object.h"
#include "wx/event.h"
};
#endif
+
+#endif
#endif
#include "wx/defs.h"
+
+#if wxUSE_BMPBUTTON
+
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
wxBitmap m_selected;
};
+#endif
+
#endif // __BMPBUTTONH__
#endif
#include "wx/defs.h"
+
+#if wxUSE_CHECKBOX
+
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
GtkWidget *m_widgetLabel;
};
+#endif
+
#endif // __GTKCHECKBOXH__
#endif
#include "wx/defs.h"
+
+#if wxUSE_CHECKLISTBOX
+
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
};
#endif
- //__GTKCHECKLISTH__
+
+#endif //__GTKCHECKLISTH__
#include "wx/defs.h"
+#if wxUSE_COMBOBOX
+
#include "wx/object.h"
#include "wx/control.h"
DECLARE_EVENT_TABLE()
};
+#endif
+
#endif
// __GTKCOMBOBOXH__
virtual void OnInternalIdle();
wxMenuBar *m_frameMenuBar;
+#if wxUSE_STATUSBAR
wxStatusBar *m_frameStatusBar;
+#endif
+#if wxUSE_TOOLBAR
wxToolBar *m_frameToolBar;
+#endif
wxString m_title;
wxIcon m_icon;
int m_miniEdge,m_miniTitle;
#endif
#include "wx/defs.h"
+
+#if wxUSE_GAUGE
+
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
bool m_useProgressBar;
};
+#endif
+
#endif // __GTKGAUGEH__
#endif
#include "wx/defs.h"
+
+#if wxUSE_LISTBOX
+
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
#endif // wxUSE_CHECKLISTBOX
};
+#endif
+
#endif // __GTKLISTBOXH__
virtual void Activate();
+#if wxUSE_STATUSBAR
// no status bars
virtual wxStatusBar* CreateStatusBar( int WXUNUSED(number)=1, long WXUNUSED(style)=1,
wxWindowID WXUNUSED(id)=1, const wxString& WXUNUSED(name)=WXSTRINGCAST NULL ) {return (wxStatusBar*)NULL; }
virtual wxStatusBar *GetStatusBar() const { return (wxStatusBar*)NULL; }
virtual void SetStatusText( const wxString &WXUNUSED(text), int WXUNUSED(number)=0 ) {}
virtual void SetStatusWidths( int WXUNUSED(n), const int WXUNUSED(widths_field)[] ) {}
+#endif
// no size hints
virtual void SetSizeHints( int WXUNUSED(minW), int WXUNUSED(minH),
int WXUNUSED(maxW), int WXUNUSED(maxH),
int WXUNUSED(incW), int WXUNUSED(incH) ) {}
+#if wxUSE_TOOLBAR
// no toolbar bars
virtual wxToolBar* CreateToolBar( long WXUNUSED(style), wxWindowID WXUNUSED(id),
const wxString& WXUNUSED(name) ) { return (wxToolBar*)NULL; }
virtual wxToolBar *GetToolBar() const { return (wxToolBar*)NULL; }
+#endif
// no icon
void SetIcon( const wxIcon &icon ) { m_icon = icon; }
#endif
#include "wx/defs.h"
+
+#if wxUSE_MINIFRAME
+
#include "wx/object.h"
#include "wx/frame.h"
int m_diffX,m_diffY;
};
+#endif
+
#endif
// __GTKMINIFRAMEH__
#endif
#include "wx/defs.h"
+
+#if wxUSE_NOTEBOOK
+
#include "wx/object.h"
#include "wx/string.h"
#include "wx/control.h"
DECLARE_EVENT_TABLE()
};
+#endif
+
#endif
// __GTKNOTEBOOKH__
#endif
#include "wx/defs.h"
+
+#if wxUSE_RADIOBOX
+
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
DECLARE_EVENT_TABLE()
};
+#endif
+
#endif // __GTKRADIOBOXH__
#endif
#include "wx/defs.h"
+
+#if wxUSE_RADIOBOX
+
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
GtkWidget* m_theOtherRadioButtton;
};
+#endif
+
#endif // __GTKRADIOBUTTONH__
#endif
#include "wx/defs.h"
+
+#if wxUSE_SCROLLBAR
+
#include "wx/object.h"
#include "wx/control.h"
float m_oldPos;
};
+#endif
+
#endif
// __GTKSCROLLBARH__
#endif
#include "wx/defs.h"
+
+#if wxUSE_SLIDER
+
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
};
+#endif
+
#endif // __GTKSLIDERH__
#endif
#include "wx/defs.h"
+
+#ifdef wxUSE_SPINBTN
+
#include "wx/object.h"
#include "wx/control.h"
{ wxEVT_SCROLL_PAGEDOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func },\
{ wxEVT_SCROLL_THUMBTRACK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func },
+#endif
+
#endif
// __GTKSPINBUTTH__
#endif
#include "wx/defs.h"
+
+#if wxUSE_STATBMP
+
#include "wx/object.h"
#include "wx/control.h"
#include "wx/bitmap.h"
wxBitmap m_bitmap;
};
+#endif
+
#endif // __GTKSTATICBITMAPH__
#endif
#include "wx/defs.h"
+
+#if wxUSE_STATBOX
+
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
void ApplyWidgetStyle();
};
+#endif
+
#endif // __GTKSTATICBOXH__
#endif
#include "wx/defs.h"
+
+#if wxUSE_STATLINE
+
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
};
+#endif
+
#endif // __GTKSTATICLINEH__
#endif
#include "wx/defs.h"
+
+#if wxUSE_TOOLBAR
+
#include "wx/control.h"
#include "wx/bitmap.h"
#include "wx/tbarbase.h"
bool m_hasToolAlready;
};
+#endif
+
#endif
// __TBARGTKH__
#endif
#include "wx/defs.h"
+
+#if wxUSE_ACCEL
+
#include "wx/object.h"
#include "wx/event.h"
};
#endif
+
+#endif
#endif
#include "wx/defs.h"
+
+#if wxUSE_BMPBUTTON
+
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
wxBitmap m_selected;
};
+#endif
+
#endif // __BMPBUTTONH__
#endif
#include "wx/defs.h"
+
+#if wxUSE_CHECKBOX
+
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
GtkWidget *m_widgetLabel;
};
+#endif
+
#endif // __GTKCHECKBOXH__
#endif
#include "wx/defs.h"
+
+#if wxUSE_CHECKLISTBOX
+
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
};
#endif
- //__GTKCHECKLISTH__
+
+#endif //__GTKCHECKLISTH__
#include "wx/defs.h"
+#if wxUSE_COMBOBOX
+
#include "wx/object.h"
#include "wx/control.h"
DECLARE_EVENT_TABLE()
};
+#endif
+
#endif
// __GTKCOMBOBOXH__
virtual void OnInternalIdle();
wxMenuBar *m_frameMenuBar;
+#if wxUSE_STATUSBAR
wxStatusBar *m_frameStatusBar;
+#endif
+#if wxUSE_TOOLBAR
wxToolBar *m_frameToolBar;
+#endif
wxString m_title;
wxIcon m_icon;
int m_miniEdge,m_miniTitle;
#endif
#include "wx/defs.h"
+
+#if wxUSE_GAUGE
+
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
bool m_useProgressBar;
};
+#endif
+
#endif // __GTKGAUGEH__
#endif
#include "wx/defs.h"
+
+#if wxUSE_LISTBOX
+
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
#endif // wxUSE_CHECKLISTBOX
};
+#endif
+
#endif // __GTKLISTBOXH__
virtual void Activate();
+#if wxUSE_STATUSBAR
// no status bars
virtual wxStatusBar* CreateStatusBar( int WXUNUSED(number)=1, long WXUNUSED(style)=1,
wxWindowID WXUNUSED(id)=1, const wxString& WXUNUSED(name)=WXSTRINGCAST NULL ) {return (wxStatusBar*)NULL; }
virtual wxStatusBar *GetStatusBar() const { return (wxStatusBar*)NULL; }
virtual void SetStatusText( const wxString &WXUNUSED(text), int WXUNUSED(number)=0 ) {}
virtual void SetStatusWidths( int WXUNUSED(n), const int WXUNUSED(widths_field)[] ) {}
+#endif
// no size hints
virtual void SetSizeHints( int WXUNUSED(minW), int WXUNUSED(minH),
int WXUNUSED(maxW), int WXUNUSED(maxH),
int WXUNUSED(incW), int WXUNUSED(incH) ) {}
+#if wxUSE_TOOLBAR
// no toolbar bars
virtual wxToolBar* CreateToolBar( long WXUNUSED(style), wxWindowID WXUNUSED(id),
const wxString& WXUNUSED(name) ) { return (wxToolBar*)NULL; }
virtual wxToolBar *GetToolBar() const { return (wxToolBar*)NULL; }
+#endif
// no icon
void SetIcon( const wxIcon &icon ) { m_icon = icon; }
#endif
#include "wx/defs.h"
+
+#if wxUSE_MINIFRAME
+
#include "wx/object.h"
#include "wx/frame.h"
int m_diffX,m_diffY;
};
+#endif
+
#endif
// __GTKMINIFRAMEH__
#endif
#include "wx/defs.h"
+
+#if wxUSE_NOTEBOOK
+
#include "wx/object.h"
#include "wx/string.h"
#include "wx/control.h"
DECLARE_EVENT_TABLE()
};
+#endif
+
#endif
// __GTKNOTEBOOKH__
#endif
#include "wx/defs.h"
+
+#if wxUSE_RADIOBOX
+
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
DECLARE_EVENT_TABLE()
};
+#endif
+
#endif // __GTKRADIOBOXH__
#endif
#include "wx/defs.h"
+
+#if wxUSE_RADIOBOX
+
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
GtkWidget* m_theOtherRadioButtton;
};
+#endif
+
#endif // __GTKRADIOBUTTONH__
#endif
#include "wx/defs.h"
+
+#if wxUSE_SCROLLBAR
+
#include "wx/object.h"
#include "wx/control.h"
float m_oldPos;
};
+#endif
+
#endif
// __GTKSCROLLBARH__
#endif
#include "wx/defs.h"
+
+#if wxUSE_SLIDER
+
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
};
+#endif
+
#endif // __GTKSLIDERH__
#endif
#include "wx/defs.h"
+
+#ifdef wxUSE_SPINBTN
+
#include "wx/object.h"
#include "wx/control.h"
{ wxEVT_SCROLL_PAGEDOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func },\
{ wxEVT_SCROLL_THUMBTRACK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func },
+#endif
+
#endif
// __GTKSPINBUTTH__
#endif
#include "wx/defs.h"
+
+#if wxUSE_STATBMP
+
#include "wx/object.h"
#include "wx/control.h"
#include "wx/bitmap.h"
wxBitmap m_bitmap;
};
+#endif
+
#endif // __GTKSTATICBITMAPH__
#endif
#include "wx/defs.h"
+
+#if wxUSE_STATBOX
+
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
void ApplyWidgetStyle();
};
+#endif
+
#endif // __GTKSTATICBOXH__
#endif
#include "wx/defs.h"
+
+#if wxUSE_STATLINE
+
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
};
+#endif
+
#endif // __GTKSTATICLINEH__
#endif
#include "wx/defs.h"
+
+#if wxUSE_TOOLBAR
+
#include "wx/control.h"
#include "wx/bitmap.h"
#include "wx/tbarbase.h"
bool m_hasToolAlready;
};
+#endif
+
#endif
// __TBARGTKH__
#endif
};
WXDLLEXPORT_DATA(extern wxMBConv) wxConvLibc;
-#define wxConv_libc wxConvLibc
#define wxANOTHER_MBCONV(type) \
class type : public wxMBConv { \
}
WXDLLEXPORT_DATA(extern wxANOTHER_MBCONV(wxMBConvFile)) wxConvFile;
-#define wxConv_file wxConvFile
WXDLLEXPORT_DATA(extern wxANOTHER_MBCONV(wxMBConvUTF7)) wxConvUTF7;
WXDLLEXPORT_DATA(extern wxANOTHER_MBCONV(wxMBConvUTF8)) wxConvUTF8;
-#define wxConv_UTF8 wxConvUTF8
-#if defined(__WXGTK12__)
+#ifdef __WXGTK12__
WXDLLEXPORT_DATA(extern wxANOTHER_MBCONV(wxMBConvGdk)) wxConvGdk;
- #define wxConv_gdk wxConvGdk
-#endif // GTK > 1.0
+#endif
class wxCharacterSet;
class WXDLLEXPORT wxCSConv : public wxMBConv
const char* cWX2MB(const char *psz) const { return psz; }
};
WXDLLEXPORT_DATA(extern wxMBConv) wxConvLibc, wxConvFile;
-#define wxConv_libc wxConvLibc
-#define wxConv_file wxConvFile
WXDLLEXPORT_DATA(extern wxMBConv *) wxConvCurrent;
-#define wxConv_current wxConvCurrent
#define wxFNCONV(name) name
#define FNSTRINGCAST WXSTRINGCAST
#endif//wxUSE_WCHAR_T
bool MyApp::OnInit(void)
{
#if defined(__WXGTK__) && defined(wxUSE_UNICODE)
- wxConvCurrent = &wxConvLocal;
+ wxConvCurrent = &wxConvLibc;
#endif
m_canvasTextColour = wxColour("BLACK");
IMPLEMENT_DYNAMIC_CLASS (MyApp, wxApp)
BEGIN_EVENT_TABLE(MyApp, wxApp)
- EVT_MENU(TYPES_DATE, MyApp::DoDateDemo)
- EVT_MENU(TYPES_TIME, MyApp::DoTimeDemo)
- EVT_MENU(TYPES_VARIANT, MyApp::DoVariantDemo)
+ EVT_MENU(TYPES_DATE, MyApp::DoDateDemo)
+ EVT_MENU(TYPES_TIME, MyApp::DoTimeDemo)
+ EVT_MENU(TYPES_VARIANT, MyApp::DoVariantDemo)
EVT_MENU(TYPES_BYTEORDER, MyApp::DoByteOrderDemo)
+#if wxUSE_UNICODE
+ EVT_MENU(TYPES_UNICODE, MyApp::DoUnicodeDemo)
+#endif
END_EVENT_TABLE()
bool MyApp::OnInit(void)
file_menu->Append(TYPES_TIME, "&Time test");
file_menu->Append(TYPES_VARIANT, "&Variant test");
file_menu->Append(TYPES_BYTEORDER, "&Byteorder test");
+#if wxUSE_UNICODE
+ file_menu->Append(TYPES_UNICODE, "&Unicode test");
+#endif
file_menu->AppendSeparator();
file_menu->Append(TYPES_QUIT, "E&xit");
wxMenuBar *menu_bar = new wxMenuBar;
return TRUE;
}
+#if wxUSE_UNICODE
+void MyApp::DoUnicodeDemo(wxCommandEvent& WXUNUSED(event))
+{
+ wxTextCtrl& textCtrl = * GetTextCtrl();
+
+ textCtrl.Clear();
+ textCtrl << "\nTest wchar_t to char (Unicode to ANSI/Multibyte) converions:";
+
+ wxString str;
+ str = _T("Robert Röbling\n");
+
+ printf( "\n\nConversion with wxConvLocal:\n" );
+ wxConvCurrent = &wxConvLocal;
+ printf( (const char*) str.mbc_str() );
+
+ printf( "\n\nConversion with wxConvGdk:\n" );
+ wxConvCurrent = &wxConvGdk;
+ printf( (const char*) str.mbc_str() );
+
+ printf( "\n\nConversion with wxConvLibc:\n" );
+ wxConvCurrent = &wxConvLibc;
+ printf( (const char*) str.mbc_str() );
+
+}
+#endif
+
void MyApp::DoByteOrderDemo(wxCommandEvent& WXUNUSED(event))
{
wxTextCtrl& textCtrl = * GetTextCtrl();
wxInt32 var = 0xF1F2F3F4;
text = "";
- text.Printf( "Value of wxInt32 is now: %#x.\n\n", var );
+ text.Printf( _T("Value of wxInt32 is now: %#x.\n\n"), var );
textCtrl.WriteText( text );
text = "";
- text.Printf( "Value of swapped wxInt32 is: %#x.\n\n", wxINT32_SWAP_ALWAYS( var ) );
+ text.Printf( _T("Value of swapped wxInt32 is: %#x.\n\n"), wxINT32_SWAP_ALWAYS( var ) );
textCtrl.WriteText( text );
text = "";
- text.Printf( "Value of wxInt32 swapped on little endian is: %#x.\n\n", wxINT32_SWAP_ON_LE( var ) );
+ text.Printf( _T("Value of wxInt32 swapped on little endian is: %#x.\n\n"), wxINT32_SWAP_ON_LE( var ) );
textCtrl.WriteText( text );
text = "";
- text.Printf( "Value of wxInt32 swapped on big endian is: %#x.\n\n", wxINT32_SWAP_ON_BE( var ) );
+ text.Printf( _T("Value of wxInt32 swapped on big endian is: %#x.\n\n"), wxINT32_SWAP_ON_BE( var ) );
textCtrl.WriteText( text );
}
long l = var1;
wxStringList stringList;
- stringList.Add("one"); stringList.Add("two"); stringList.Add("three");
+ stringList.Add(_T("one")); stringList.Add(_T("two")); stringList.Add(_T("three"));
var1 = stringList;
textCtrl << "var1 = " << var1.MakeString() << "\n";
void DoTimeDemo(wxCommandEvent& event);
void DoVariantDemo(wxCommandEvent& event);
void DoByteOrderDemo(wxCommandEvent& event);
+#if wxUSE_UNICODE
+ void DoUnicodeDemo(wxCommandEvent& event);
+#endif
wxTextCtrl* GetTextCtrl() const { return m_textCtrl; }
#define TYPES_TIME 104
#define TYPES_VARIANT 105
#define TYPES_BYTEORDER 106
+#define TYPES_UNICODE 107
#endif
// _WX_TYPETEST_H_
{
struct stat st;
#if wxUSE_UNICODE && wxMBFILES
- wxCharBuffer fname = wxConv_file.cWC2MB(name);
+ wxCharBuffer fname = wxConvFile.cWC2MB(name);
return !access(fname, 0) &&
!stat(MBSTRINGCAST fname, &st) &&
// does the path exists? (may have or not '/' or '\\' at the end)
bool wxPathExists(const wxChar *pszPathName)
{
- // Windows API returns -1 from stat for "c:\dir\" if "c:\dir" exists
- // OTOH, we should change "d:" to "d:\" and leave "\" as is.
+ /* Windows API returns -1 from stat for "c:\dir\" if "c:\dir" exists
+ * OTOH, we should change "d:" to "d:\" and leave "\" as is. */
wxString strPath(pszPathName);
if ( wxEndsWithPathSeparator(pszPathName) && pszPathName[1] != _T('\0') )
strPath.Last() = _T('\0');
}
#if wxUSE_UNICODE
else {
- wxConv_file.MB2WC(buf, cbuf, sz);
+ wxConvFile.MB2WC(buf, cbuf, sz);
delete [] cbuf;
}
#endif
return szDomain;
const char *pszTrans = NULL;
- const wxWX2MBbuf szOrgString = wxConv_libc.cWX2MB(szOrigString);
+ const wxWX2MBbuf szOrgString = wxConvCurrent->cWX2MB(szOrigString);
wxMsgCatalog *pMsgCat;
if ( szDomain != NULL ) {
return (wxMB2WXbuf)(szOrigString);
}
else
- return (wxMB2WXbuf)(wxConv_libc.cMB2WX(pszTrans));
+ return (wxMB2WXbuf)(wxConvCurrent->cMB2WX(pszTrans));
}
// find catalog by name in a linked list, return NULL if !found
void wxLogStream::DoLogString(const wxChar *szString, time_t WXUNUSED(t))
{
- (*m_ostr) << wxConv_libc.cWX2MB(szString) << endl << flush;
+ (*m_ostr) << wxConvCurrent->cWX2MB(szString) << endl << flush;
}
#endif // wxUSE_STD_IOSTREAM
#else // Unix
#if wxUSE_UNICODE
static wxChar s_szBuf[LOG_BUFFER_SIZE / 2];
- wxConv_libc.MB2WC(s_szBuf, strerror(nErrCode), WXSIZEOF(s_szBuf) -1);
+ wxConvCurrent->MB2WC(s_szBuf, strerror(nErrCode), WXSIZEOF(s_szBuf) -1);
return s_szBuf;
#else
return strerror(nErrCode);
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;
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);
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;
// conditional compilation
// ----------------------------------------------------------------------------
+#if !defined(__WXSW__) && wxUSE_UNICODE
+ #ifdef wxUSE_EXPERIMENTAL_PRINTF
+ #undef wxUSE_EXPERIMENTAL_PRINTF
+ #endif
+ #define wxUSE_EXPERIMENTAL_PRINTF 1
+#endif
+
// we want to find out if the current platform supports vsnprintf()-like
// function: for Unix this is done with configure, for Windows we test the
// compiler explicitly.
wxString uni = token.GetNextToken();
// skip whitespace again
while (wxIsEmpty(uni) && token.HasMoreTokens()) uni = token.GetNextToken();
-
if ((hex.Len() > 2) && (wxString(hex.GetChar(0)) == escchar) && (hex.GetChar(1) == _T('x')) &&
(uni.Left(2) == _T("<U"))) {
hex.MakeUpper(); uni.MakeUpper();
return FALSE;
// bool controls
+#if wxUSE_CHECKBOX
if (m_validatorWindow->IsKindOf(CLASSINFO(wxCheckBox)) )
{
wxCheckBox* pControl = (wxCheckBox*) m_validatorWindow;
pControl->SetValue(*m_pBool) ;
return TRUE;
}
- }
- else if (m_validatorWindow->IsKindOf(CLASSINFO(wxRadioButton)) )
+ } else
+#endif
+#if wxUSE_RADIOBTN
+ if (m_validatorWindow->IsKindOf(CLASSINFO(wxRadioButton)) )
{
wxRadioButton* pControl = (wxRadioButton*) m_validatorWindow;
if (m_pBool)
pControl->SetValue(*m_pBool) ;
return TRUE;
}
- }
+ } else
+#endif
// int controls
- else if (m_validatorWindow->IsKindOf(CLASSINFO(wxGauge)) )
+#if wxUSE_GAUGE
+ if (m_validatorWindow->IsKindOf(CLASSINFO(wxGauge)) )
{
wxGauge* pControl = (wxGauge*) m_validatorWindow;
if (m_pInt)
return TRUE;
}
}
- else if (m_validatorWindow->IsKindOf(CLASSINFO(wxRadioBox)) )
+ else
+#endif
+#if wxUSE_RADIOBOX
+ if (m_validatorWindow->IsKindOf(CLASSINFO(wxRadioBox)) )
{
wxRadioBox* pControl = (wxRadioBox*) m_validatorWindow;
if (m_pInt)
return TRUE;
}
}
- else if (m_validatorWindow->IsKindOf(CLASSINFO(wxScrollBar)) )
+ else
+#endif
+#if wxUSE_SCROLLBAR
+ if (m_validatorWindow->IsKindOf(CLASSINFO(wxScrollBar)) )
{
wxScrollBar* pControl = (wxScrollBar*) m_validatorWindow;
if (m_pInt)
pControl->SetThumbPosition(*m_pInt) ;
return TRUE;
}
- }
+ } else
+#endif
+#if wxUSE_SPINBTN
#ifndef __WIN16__
- else if (m_validatorWindow->IsKindOf(CLASSINFO(wxSpinButton)) )
+ if (m_validatorWindow->IsKindOf(CLASSINFO(wxSpinButton)) )
{
wxSpinButton* pControl = (wxSpinButton*) m_validatorWindow;
if (m_pInt)
pControl->SetValue(*m_pInt) ;
return TRUE;
}
- }
+ } else
+#endif
#endif
// string controls
- else if (m_validatorWindow->IsKindOf(CLASSINFO(wxButton)) )
+ if (m_validatorWindow->IsKindOf(CLASSINFO(wxButton)) )
{
wxButton* pControl = (wxButton*) m_validatorWindow;
if (m_pString)
pControl->SetLabel(*m_pString) ;
return TRUE;
}
- }
- else if (m_validatorWindow->IsKindOf(CLASSINFO(wxComboBox)) )
+ } else
+#if wxUSE_COMBOBOX
+ if (m_validatorWindow->IsKindOf(CLASSINFO(wxComboBox)) )
{
wxComboBox* pControl = (wxComboBox*) m_validatorWindow;
if (m_pString)
return TRUE;
}
}
+#endif
else if (m_validatorWindow->IsKindOf(CLASSINFO(wxChoice)) )
{
wxChoice* pControl = (wxChoice*) m_validatorWindow;
pControl->SetValue(*m_pString) ;
return TRUE;
}
- }
+ } else
+#if wxUSE_CHECKLISTBOX
#ifndef __WIN16__
// array controls
// NOTE: wxCheckListBox isa wxListBox, so wxCheckListBox
// MUST come first:
- else if (m_validatorWindow->IsKindOf(CLASSINFO(wxCheckListBox)) )
+ if (m_validatorWindow->IsKindOf(CLASSINFO(wxCheckListBox)) )
{
wxCheckListBox* pControl = (wxCheckListBox*) m_validatorWindow;
if (m_pArrayInt)
}
else
return FALSE;
- }
+ } else
#endif
- else if (m_validatorWindow->IsKindOf(CLASSINFO(wxListBox)) )
+#endif
+#if wxUSE_LISTBOX
+ if (m_validatorWindow->IsKindOf(CLASSINFO(wxListBox)) )
{
wxListBox* pControl = (wxListBox*) m_validatorWindow;
if (m_pArrayInt)
pControl->SetSelection(m_pArrayInt->Item(u));
return TRUE;
}
- }
+ } else
+#endif
// unrecognized control, or bad pointer
+ return FALSE;
return FALSE;
}
return FALSE;
// bool controls
+#if wxUSE_CHECKBOX
if (m_validatorWindow->IsKindOf(CLASSINFO(wxCheckBox)) )
{
wxCheckBox* pControl = (wxCheckBox*) m_validatorWindow;
*m_pBool = pControl->GetValue() ;
return TRUE;
}
- }
- else if (m_validatorWindow->IsKindOf(CLASSINFO(wxRadioButton)) )
+ } else
+#endif
+#if wxUSE_RADIOBTN
+ if (m_validatorWindow->IsKindOf(CLASSINFO(wxRadioButton)) )
{
wxRadioButton* pControl = (wxRadioButton*) m_validatorWindow;
if (m_pBool)
*m_pBool = pControl->GetValue() ;
return TRUE;
}
- }
+ } else
+#endif
// int controls
- else if (m_validatorWindow->IsKindOf(CLASSINFO(wxGauge)) )
+#if wxUSE_GAUGE
+ if (m_validatorWindow->IsKindOf(CLASSINFO(wxGauge)) )
{
wxGauge* pControl = (wxGauge*) m_validatorWindow;
if (m_pInt)
*m_pInt = pControl->GetValue() ;
return TRUE;
}
- }
- else if (m_validatorWindow->IsKindOf(CLASSINFO(wxRadioBox)) )
+ } else
+#endif
+#if wxUSE_RADIOBOX
+ if (m_validatorWindow->IsKindOf(CLASSINFO(wxRadioBox)) )
{
wxRadioBox* pControl = (wxRadioBox*) m_validatorWindow;
if (m_pInt)
*m_pInt = pControl->GetSelection() ;
return TRUE;
}
- }
- else if (m_validatorWindow->IsKindOf(CLASSINFO(wxScrollBar)) )
+ } else
+#endif
+#if wxUSE_SCROLLBAR
+ if (m_validatorWindow->IsKindOf(CLASSINFO(wxScrollBar)) )
{
wxScrollBar* pControl = (wxScrollBar*) m_validatorWindow;
if (m_pInt)
*m_pInt = pControl->GetThumbPosition() ;
return TRUE;
}
- }
+ } else
+#endif
+#if wxUSE_SPINBTN
#ifndef __WIN16__
- else if (m_validatorWindow->IsKindOf(CLASSINFO(wxSpinButton)) )
+ if (m_validatorWindow->IsKindOf(CLASSINFO(wxSpinButton)) )
{
wxSpinButton* pControl = (wxSpinButton*) m_validatorWindow;
if (m_pInt)
*m_pInt = pControl->GetValue() ;
return TRUE;
}
- }
+ } else
+#endif
#endif
// string controls
- else if (m_validatorWindow->IsKindOf(CLASSINFO(wxButton)) )
+ if (m_validatorWindow->IsKindOf(CLASSINFO(wxButton)) )
{
wxButton* pControl = (wxButton*) m_validatorWindow;
if (m_pString)
return TRUE;
}
}
- else if (m_validatorWindow->IsKindOf(CLASSINFO(wxComboBox)) )
+ else
+#if wxUSE_COMBOBOX
+ if (m_validatorWindow->IsKindOf(CLASSINFO(wxComboBox)) )
{
wxComboBox* pControl = (wxComboBox*) m_validatorWindow;
if (m_pString)
*m_pString = pControl->GetValue() ;
return TRUE;
}
- }
- else if (m_validatorWindow->IsKindOf(CLASSINFO(wxChoice)) )
+ } else
+#endif
+ if (m_validatorWindow->IsKindOf(CLASSINFO(wxChoice)) )
{
wxChoice* pControl = (wxChoice*) m_validatorWindow;
if (m_pInt)
*m_pInt = pControl->GetSelection() ;
return TRUE;
}
- }
- else if (m_validatorWindow->IsKindOf(CLASSINFO(wxStaticText)) )
+ } else
+ if (m_validatorWindow->IsKindOf(CLASSINFO(wxStaticText)) )
{
wxStaticText* pControl = (wxStaticText*) m_validatorWindow;
if (m_pString)
*m_pString = pControl->GetLabel() ;
return TRUE;
}
- }
- else if (m_validatorWindow->IsKindOf(CLASSINFO(wxTextCtrl)) )
+ } else
+ if (m_validatorWindow->IsKindOf(CLASSINFO(wxTextCtrl)) )
{
wxTextCtrl* pControl = (wxTextCtrl*) m_validatorWindow;
if (m_pString)
*m_pString = pControl->GetValue() ;
return TRUE;
}
- }
+ } else
+#if wxUSE_LISTBOX
#ifndef __WIN16__
// array controls
// NOTE: wxCheckListBox isa wxListBox, so wxCheckListBox
// MUST come first:
- else if (m_validatorWindow->IsKindOf(CLASSINFO(wxCheckListBox)) )
+ if (m_validatorWindow->IsKindOf(CLASSINFO(wxCheckListBox)) )
{
wxCheckListBox* pControl = (wxCheckListBox*) m_validatorWindow;
if (m_pArrayInt)
}
else
return FALSE;
- }
+ } else
+#endif
#endif
- else if (m_validatorWindow->IsKindOf(CLASSINFO(wxListBox)) )
+#if wxUSE_LISTBOX
+ if (m_validatorWindow->IsKindOf(CLASSINFO(wxListBox)) )
{
wxListBox* pControl = (wxListBox*) m_validatorWindow;
if (m_pArrayInt)
m_pArrayInt->Add(i);
return TRUE;
}
- }
+ } else
+#endif
// unrecognized control, or bad pointer
+ return FALSE;
return FALSE;
}
#ifndef wxSetlocale
wxChar * WXDLLEXPORT wxSetlocale(int category, const wxChar *locale)
{
- setlocale(category, wxConv_libc.cWX2MB(locale));
+ setlocale(category, wxConvLibc.cWX2MB(locale));
// FIXME
return (wxChar *)NULL;
}
int ret;
// this will work only for numeric conversion! Strings will not be converted correctly
// hopefully this is all we'll need
- ret = vsscanf(wxConv_libc.cWX2MB(buf), wxConv_libc.cWX2MB(fmt), argptr);
+ ret = vsscanf(wxConvLibc.cWX2MB(buf), wxConvLibc.cWX2MB(fmt), argptr);
return ret;
}
#endif
#ifndef wxAtof
double WXDLLEXPORT wxAtof(const wxChar *psz)
{
- return atof(wxConv_libc.cWX2MB(psz));
+ return atof(wxConvLibc.cWX2MB(psz));
}
#endif
#ifdef wxNEED_WX_STDLIB_H
int WXDLLEXPORT wxAtoi(const wxChar *psz)
{
- return atoi(wxConv_libc.cWX2MB(psz));
+ return atoi(wxConvLibc.cWX2MB(psz));
}
long WXDLLEXPORT wxAtol(const wxChar *psz)
{
- return atol(wxConv_libc.cWX2MB(psz));
+ return atol(wxConvLibc.cWX2MB(psz));
}
wxChar * WXDLLEXPORT wxGetenv(const wxChar *name)
wxObject *data = env.Get(name);
if (!data) {
// nope, retrieve it,
- const char *val = getenv(wxConv_libc.cWX2MB(name));
+ const char *val = getenv(wxConvLibc.cWX2MB(name));
if (!val) return (wxChar *)NULL;
// convert it,
data = (wxObject *)new wxString(val);
int WXDLLEXPORT wxSystem(const wxChar *psz)
{
- return system(wxConv_libc.cWX2MB(psz));
+ return system(wxConvLibc.cWX2MB(psz));
}
#endif
{
stream << "\"";
int i;
- const wxWX2MBbuf val = wxConv_libc.cWX2MB(value.string);
+ const wxWX2MBbuf val = wxConvLibc.cWX2MB(value.string);
int len = strlen(val);
for (i = 0; i < len; i++)
{
case wxExprWord:
{
bool quote_it = FALSE;
- const wxWX2MBbuf val = wxConv_libc.cWX2MB(value.word);
+ const wxWX2MBbuf val = wxConvLibc.cWX2MB(value.word);
int len = strlen(val);
if ((len == 0) || (len > 0 && (val[0] > 64 && val[0] < 91)))
quote_it = TRUE;
{
wxChar *s, *t;
int len, i;
- const wxMB2WXbuf sbuf = wxConv_libc.cMB2WX(str);
+ const wxMB2WXbuf sbuf = wxConvLibc.cMB2WX(str);
// str++; /* skip leading quote */
len = wxStrlen(sbuf) - 1; /* ignore trailing quote */
#pragma hdrstop
#endif
-#if wxUSE_CONSTRAINTS
-
#ifndef WX_PRECOMP
- #include <stdio.h>
- #include "wx/utils.h"
- #include "wx/dialog.h"
- #include "wx/listbox.h"
- #include "wx/button.h"
- #include "wx/stattext.h"
- #include "wx/layout.h"
- #include "wx/intl.h"
+ #include <stdio.h>
+ #include "wx/utils.h"
+ #include "wx/dialog.h"
+ #include "wx/button.h"
+ #include "wx/listbox.h"
+ #include "wx/stattext.h"
+ #include "wx/intl.h"
+#endif
+
+#if wxUSE_STATLINE
+ #include "wx/statline.h"
#endif
#include "wx/generic/choicdgg.h"
-// Split message, using constraints to position controls
-static void wxSplitMessage2(const wxChar *message, wxList *messageList, wxWindow *parent, wxRowColSizer *sizer)
+/* Split message, using constraints to position controls */
+static wxSize wxSplitMessage2( const wxString &message, wxWindow *parent )
{
- wxChar *copyMessage = copystring(message);
- size_t i = 0;
- size_t len = wxStrlen(copyMessage);
- wxChar *currentMessage = copyMessage;
-
-// wxWindow *lastWindow = parent;
-
- while (i < len) {
- while ((i < len) && (copyMessage[i] != _T('\n'))) i++;
- if (i < len) copyMessage[i] = 0;
- wxStaticText *mess = new wxStaticText(parent, -1, currentMessage);
-
-/*
- wxLayoutConstraints *c = new wxLayoutConstraints;
- c->left.SameAs (parent, wxLeft, 10);
- c->top.SameAs (lastWindow, wxBottom, 5);
- c->right.AsIs ();
- c->height.AsIs ();
-
- mess->SetConstraints(c);
-*/
- sizer->AddSizerChild(mess);
-
- messageList->Append(mess);
-
- currentMessage = copyMessage + i + 1;
- }
- delete[] copyMessage;
+ int y = 10;
+ int w = 50;
+ wxString line( _T("") );
+ for (uint pos = 0; pos < message.Len(); pos++)
+ {
+ if (message[pos] == _T('\n'))
+ {
+ if (!line.IsEmpty())
+ {
+ wxStaticText *s1 = new wxStaticText( parent, -1, line, wxPoint(15,y) );
+ wxSize size1( s1->GetSize() );
+ if (size1.x > w) w = size1.x;
+ line = _T("");
+ }
+ y += 18;
+ }
+ else
+ {
+ line += message[pos];
+ }
+ }
+
+ if (!line.IsEmpty())
+ {
+ wxStaticText *s2 = new wxStaticText( parent, -1, line, wxPoint(15,y) );
+ wxSize size2( s2->GetSize() );
+ if (size2.x > w) w = size2.x;
+ }
+
+ y += 18;
+
+ return wxSize(w+30,y);
}
+
wxString wxGetSingleChoice( const wxString& message, const wxString& caption, int n,
const wxString *choices, wxWindow *parent,
int WXUNUSED(x), int WXUNUSED(y), bool WXUNUSED(centre),
{
wxSingleChoiceDialog dialog(parent, message, caption, n, choices);
if ( dialog.ShowModal() == wxID_OK )
- {
return dialog.GetStringSelection();
- }
else
- return "";
+ return _T("");
}
// Overloaded for backward compatibility
{
wxSingleChoiceDialog dialog(parent, message, caption, n, choices);
if ( dialog.ShowModal() == wxID_OK )
- {
return dialog.GetSelection();
- }
else
return -1;
}
int width, int height )
{
wxString *strings = new wxString[n];
- int i;
- for ( i = 0; i < n; i++)
- {
+ for ( int i = 0; i < n; i++)
strings[i] = choices[i];
- }
int ans = wxGetSingleChoiceIndex(message, caption, n, (const wxString *)strings, parent,
x, y, centre, width, height);
delete[] strings;
{
wxSingleChoiceDialog dialog(parent, message, caption, n, choices, client_data);
if ( dialog.ShowModal() == wxID_OK )
- {
return dialog.GetSelectionClientData();
- }
else
return NULL;
}
m_clientData = NULL;
wxBeginBusyCursor();
-
- wxSizer *topSizer = new wxSizer(this, wxSizerShrink);
- topSizer->SetBorder(10, 10);
-
- wxRowColSizer *messageSizer = new wxRowColSizer(topSizer, wxSIZER_COLS, 100);
- messageSizer->SetName(_T("messageSizer"));
-
- // bool centre = ((style & wxCENTRE) == wxCENTRE);
-
- wxList messageList;
- wxSplitMessage2(message, &messageList, this, messageSizer);
-
- // Insert a spacer
- wxSpacingSizer *spacingSizer = new wxSpacingSizer(topSizer, wxBelow, messageSizer, 10);
-
- wxListBox *listBox = new wxListBox(this, wxID_LISTBOX, wxPoint(-1, -1), wxSize(240, 160),
- n, choices);
- listBox->SetSelection(m_selection);
- if ( clientData )
+
+ wxSize message_size( wxSplitMessage2( message, this ) );
+
+ wxButton *ok = (wxButton *) NULL;
+ wxButton *cancel = (wxButton *) NULL;
+ wxList m_buttons;
+
+ int y = message_size.y + 15;
+
+ int listbox_height = wxMin( 160, n*20 );
+
+ wxListBox *listBox = new wxListBox( this, wxID_LISTBOX, wxPoint(10, y), wxSize(240, listbox_height),
+ n, choices, wxLB_ALWAYS_SB );
+ listBox->SetSelection( m_selection );
+ if (clientData)
{
- int i;
- for ( i = 0; i < n; i++)
- {
+ for (int i = 0; i < n; i++)
listBox->SetClientData(i, clientData[i]);
- }
}
+
+ y += listbox_height + 35;
- wxRowColSizer *listBoxSizer = new wxRowColSizer(topSizer, wxSIZER_ROWS);
- listBoxSizer->AddSizerChild(listBox);
- listBoxSizer->SetName(_T("listBoxSizer"));
-
- // Create constraints for the text sizer
- wxLayoutConstraints *textC = new wxLayoutConstraints;
- textC->left.SameAs (messageSizer, wxLeft);
- textC->top.Below (spacingSizer);
- listBoxSizer->SetConstraints(textC);
-
- // Insert another spacer
- wxSpacingSizer *spacingSizer2 = new wxSpacingSizer(topSizer, wxBelow, listBoxSizer, 10);
- spacingSizer->SetName(_T("spacingSizer2"));
-
- // Insert a sizer for the buttons
- wxRowColSizer *buttonSizer = new wxRowColSizer(topSizer, wxSIZER_ROWS);
- buttonSizer->SetName(_T("buttonSizer"));
- buttonSizer->SetSpacing(12,0);
-
- // Specify constraints for the button sizer
- wxLayoutConstraints *c = new wxLayoutConstraints;
- c->width.AsIs ();
- c->height.AsIs ();
- c->top.Below (spacingSizer2);
- c->centreX.SameAs (listBoxSizer, wxCentreX);
- buttonSizer->SetConstraints(c);
-
- wxButton *ok = NULL;
- wxButton *cancel = NULL;
-
- if (style & wxOK) {
- ok = new wxButton(this, wxID_OK, _("OK"), wxDefaultPosition, wxSize(75,-1) );
- buttonSizer->AddSizerChild(ok);
+ if (style & wxOK)
+ {
+ ok = new wxButton( this, wxID_OK, _("OK"), wxPoint(-1,y), wxSize(80,-1) );
+ m_buttons.Append( ok );
}
- if (style & wxCANCEL) {
- cancel = new wxButton(this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxSize(75,-1));
- buttonSizer->AddSizerChild(cancel);
+ if (style & wxCANCEL)
+ {
+ cancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxPoint(-1,y), wxSize(80,-1) );
+ m_buttons.Append( cancel );
}
if (ok)
ok->SetFocus();
}
- Layout();
- Centre(wxBOTH);
+ int w = m_buttons.GetCount() * 100;
+ if (message_size.x > w) w = message_size.x;
+ int space = w / (m_buttons.GetCount()*2);
+
+ listBox->SetSize( 20, -1, w-10, listbox_height );
+
+ int m = 0;
+ wxNode *node = m_buttons.First();
+ while (node)
+ {
+ wxWindow *win = (wxWindow*)node->Data();
+ int x = (m*2+1)*space - 40 + 15;
+ win->Move( x, -1 );
+ node = node->Next();
+ m++;
+ }
+
+#if wxUSE_STATLINE
+ (void) new wxStaticLine( this, -1, wxPoint(0,y-20), wxSize(w+30, 5) );
+#endif
+
+ SetSize( w+30, y+40 );
+
+ Centre( wxBOTH );
wxEndBusyCursor();
EndModal(wxID_OK);
}
-#endif // wxUSE_CONSTRAINTS
-
wxChar *header_file = wxGetTempFileName("ps");
- m_pstream = new ofstream( wxConv_file.cWX2MB(header_file) );
+ m_pstream = new ofstream( wxConvCurrent->cWX2MB(header_file) );
*m_pstream << "%!PS-Adobe-2.0\n"; /* PostScript magic strings */
*m_pstream << "%%Title: " << m_title.mb_str() << "\n";
wxChar userID[256];
if ( wxGetEmailAddress(userID, sizeof(userID)) )
{
- *m_pstream << "%%For: " << MBSTRINGCAST wxConv_libc.cWX2MB(userID);
+ *m_pstream << "%%For: " << MBSTRINGCAST wxConvCurrent->cWX2MB(userID);
wxChar userName[245];
if (wxGetUserName(userName, sizeof(userName)))
- *m_pstream << " (" << MBSTRINGCAST wxConv_libc.cWX2MB(userName) << ")";
+ *m_pstream << " (" << MBSTRINGCAST wxConvCurrent->cWX2MB(userName) << ")";
*m_pstream << "\n";
}
else if ( wxGetUserName(userID, sizeof(userID)) )
{
- *m_pstream << "%%For: " << MBSTRINGCAST wxConv_libc.cWX2MB(userID) << "\n";
+ *m_pstream << "%%For: " << MBSTRINGCAST wxConvCurrent->cWX2MB(userID) << "\n";
}
// THE FOLLOWING HAS BEEN CONTRIBUTED BY Andy Fyfe <andy@hyperparallel.com>
#endif
#ifndef WX_PRECOMP
-#include "wx/utils.h"
-#include "wx/dialog.h"
-#include "wx/listbox.h"
-#include "wx/button.h"
-#include "wx/stattext.h"
-#include "wx/layout.h"
-#include "wx/intl.h"
+ #include "wx/utils.h"
+ #include "wx/dialog.h"
+ #include "wx/button.h"
+ #include "wx/stattext.h"
+ #include "wx/intl.h"
#endif
#include <stdio.h>
#include "wx/generic/msgdlgg.h"
-#ifdef __WXGTK__
-#include "wx/statline.h"
+#if wxUSE_STATLINE
+ #include "wx/statline.h"
#endif
-///////////////////////////////////////////////////////////////////
-// New dialog box implementations
-
-// Split message, using constraints to position controls
-wxSize wxSplitMessage2( const wxString &message, wxWindow *parent )
+/* Split message, using constraints to position controls */
+static wxSize wxSplitMessage2( const wxString &message, wxWindow *parent )
{
int y = 10;
int w = 50;
{
m_dialogStyle = style;
+ wxBeginBusyCursor();
+
wxSize message_size( wxSplitMessage2( message, this ) );
wxButton *ok = (wxButton *) NULL;
n++;
}
-#if wxUSE_STATICLINE
+#if wxUSE_STATLINE
(void) new wxStaticLine( this, -1, wxPoint(0,y-20), wxSize(w+30, 5) );
#endif
SetSize( w+30, y+40 );
Centre( wxBOTH );
+
+ wxEndBusyCursor();
}
void wxGenericMessageDialog::OnYes(wxCommandEvent& WXUNUSED(event))
m_noCopiesText = new wxTextCtrl(this, wxPRINTID_COPIES, "", wxPoint(252, 130), wxSize(40, -1));
- wxButton *okButton = new wxButton(this, wxID_OK, _("OK"), wxPoint(40, 180), wxSize(100, -1));
- (void) new wxButton(this, wxID_CANCEL, _("Cancel"), wxPoint(180, 180), wxSize(100, -1));
+ wxButton *okButton = new wxButton(this, wxID_OK, _("OK"), wxPoint(40, 180), wxSize(80, -1));
+ (void) new wxButton(this, wxID_CANCEL, _("Cancel"), wxPoint(180, 180), wxSize(80, -1));
okButton->SetDefault();
okButton->SetFocus();
m_printerOptionsText = new wxTextCtrl(this, wxPRINTID_OPTIONS, "", wxPoint(360, 135), wxSize(150, -1));
- wxButton *okButton = new wxButton(this, wxID_OK, _("OK"), wxPoint(130, 200), wxSize(100, -1));
- (void) new wxButton(this, wxID_CANCEL, _("Cancel"), wxPoint(320, 200), wxSize(100, -1));
+ wxButton *okButton = new wxButton(this, wxID_OK, _("OK"), wxPoint(130, 200), wxSize(80, -1));
+ (void) new wxButton(this, wxID_CANCEL, _("Cancel"), wxPoint(320, 200), wxSize(80, -1));
okButton->SetDefault();
okButton->SetFocus();
{
// stream << "\"";
int i;
- const wxWX2MBbuf strbuf = wxConv_libc.cWX2MB(m_value.string);
+ const wxWX2MBbuf strbuf = wxConvCurrent->cWX2MB(m_value.string);
int len = strlen(strbuf);
for (i = 0; i < len; i++)
{
#endif
#ifndef WX_PRECOMP
-#include <stdio.h>
-#include "wx/utils.h"
-#include "wx/dialog.h"
-#include "wx/listbox.h"
-#include "wx/button.h"
-#include "wx/stattext.h"
-#include "wx/textctrl.h"
-#include "wx/layout.h"
-#include "wx/intl.h"
+ #include <stdio.h>
+ #include "wx/utils.h"
+ #include "wx/dialog.h"
+ #include "wx/button.h"
+ #include "wx/stattext.h"
+ #include "wx/textctrl.h"
+ #include "wx/intl.h"
+#endif
+
+#if wxUSE_STATLINE
+ #include "wx/statline.h"
#endif
#include "wx/generic/textdlgg.h"
+/* Split message, using constraints to position controls */
+static wxSize wxSplitMessage2( const wxString &message, wxWindow *parent )
+{
+ int y = 10;
+ int w = 50;
+ wxString line( _T("") );
+ for (uint pos = 0; pos < message.Len(); pos++)
+ {
+ if (message[pos] == _T('\n'))
+ {
+ if (!line.IsEmpty())
+ {
+ wxStaticText *s1 = new wxStaticText( parent, -1, line, wxPoint(15,y) );
+ wxSize size1( s1->GetSize() );
+ if (size1.x > w) w = size1.x;
+ line = _T("");
+ }
+ y += 18;
+ }
+ else
+ {
+ line += message[pos];
+ }
+ }
+
+ if (!line.IsEmpty())
+ {
+ wxStaticText *s2 = new wxStaticText( parent, -1, line, wxPoint(15,y) );
+ wxSize size2( s2->GetSize() );
+ if (size2.x > w) w = size2.x;
+ }
+
+ y += 18;
+
+ return wxSize(w+30,y);
+}
+
// wxTextEntryDialog
#if !USE_SHARED_LIBRARY
IMPLEMENT_CLASS(wxTextEntryDialog, wxDialog)
#endif
-// Split message, using constraints to position controls
-static void wxSplitMessage2(const wxChar *message, wxList *messageList, wxWindow *parent, wxRowColSizer *sizer)
-{
- wxChar *copyMessage = copystring(message);
- size_t i = 0;
- size_t len = wxStrlen(copyMessage);
- wxChar *currentMessage = copyMessage;
-
-// wxWindow *lastWindow = parent;
-
- while (i < len) {
- while ((i < len) && (copyMessage[i] != _T('\n'))) i++;
- if (i < len) copyMessage[i] = 0;
- wxStaticText *mess = new wxStaticText(parent, -1, currentMessage);
-
-/*
- wxLayoutConstraints *c = new wxLayoutConstraints;
- c->left.SameAs (parent, wxLeft, 10);
- c->top.SameAs (lastWindow, wxBottom, 5);
- c->right.AsIs ();
- c->height.AsIs ();
-
- mess->SetConstraints(c);
-*/
- sizer->AddSizerChild(mess);
-
- messageList->Append(mess);
-
- currentMessage = copyMessage + i + 1;
- }
- delete[] copyMessage;
-}
-
wxTextEntryDialog::wxTextEntryDialog(wxWindow *parent, const wxString& message, const wxString& caption,
const wxString& value, long style, const wxPoint& pos):
wxDialog(parent, -1, caption, pos, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxDIALOG_MODAL|wxTAB_TRAVERSAL)
{
- m_dialogStyle = style;
- m_value = value;
-
- wxBeginBusyCursor();
-
- wxSizer *topSizer = new wxSizer(this, wxSizerShrink);
- topSizer->SetBorder(10, 10);
-
- wxRowColSizer *messageSizer = new wxRowColSizer(topSizer, wxSIZER_COLS, 100);
- messageSizer->SetName("messageSizer");
-
-// bool centre = ((style & wxCENTRE) == wxCENTRE);
-
- wxList messageList;
- wxSplitMessage2(message, &messageList, this, messageSizer);
-
- // Insert a spacer
- wxSpacingSizer *spacingSizer = new wxSpacingSizer(topSizer, wxBelow, messageSizer, 10);
-
- wxTextCtrl *textCtrl = new wxTextCtrl(this, wxID_TEXT, value, wxPoint(-1, -1), wxSize(350, -1));
-
- wxRowColSizer *textSizer = new wxRowColSizer(topSizer, wxSIZER_ROWS);
- textSizer->AddSizerChild(textCtrl);
- textSizer->SetName("textSizer");
-
- // Create constraints for the text sizer
- wxLayoutConstraints *textC = new wxLayoutConstraints;
- textC->left.SameAs (messageSizer, wxLeft);
- textC->top.Below (spacingSizer);
- textSizer->SetConstraints(textC);
-
- // Insert another spacer
- wxSpacingSizer *spacingSizer2 = new wxSpacingSizer(topSizer, wxBelow, textSizer, 10);
- spacingSizer->SetName("spacingSizer2");
-
- // Insert a sizer for the buttons
- wxRowColSizer *buttonSizer = new wxRowColSizer(topSizer, wxSIZER_ROWS);
- buttonSizer->SetName("buttonSizer");
-
- // Specify constraints for the button sizer
- wxLayoutConstraints *c = new wxLayoutConstraints;
- c->width.AsIs ();
- c->height.AsIs ();
- c->top.Below (spacingSizer2);
- c->centreX.SameAs (textSizer, wxCentreX);
- buttonSizer->SetConstraints(c);
- buttonSizer->SetSpacing(12,0);
-
- wxButton *ok = NULL;
- wxButton *cancel = NULL;
-
- if (style & wxOK) {
- ok = new wxButton(this, wxID_OK, _("OK"), wxDefaultPosition, wxSize(75,-1));
- buttonSizer->AddSizerChild(ok);
- }
-
- if (style & wxCANCEL) {
- cancel = new wxButton(this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxSize(75,-1));
- buttonSizer->AddSizerChild(cancel);
- }
+ m_dialogStyle = style;
+ m_value = value;
+
+ wxBeginBusyCursor();
+
+ wxSize message_size( wxSplitMessage2( message, this ) );
+
+ wxButton *ok = (wxButton *) NULL;
+ wxButton *cancel = (wxButton *) NULL;
+ wxList m_buttons;
+
+ int y = message_size.y + 15;
+
+ wxTextCtrl *textCtrl = new wxTextCtrl(this, wxID_TEXT, value, wxPoint(-1, y), wxSize(350, -1));
+
+ y += 65;
+
+ if (style & wxOK)
+ {
+ ok = new wxButton( this, wxID_OK, _("OK"), wxPoint(-1,y), wxSize(80,-1) );
+ m_buttons.Append( ok );
+ }
+
+ if (style & wxCANCEL)
+ {
+ cancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxPoint(-1,y), wxSize(80,-1) );
+ m_buttons.Append( cancel );
+ }
+
+ if (ok)
+ {
+ ok->SetDefault();
+ ok->SetFocus();
+ }
+
+ int w = wxMax( 350, m_buttons.GetCount() * 100 );
+ w = wxMax( w, message_size.x );
+ int space = w / (m_buttons.GetCount()*2);
+
+ textCtrl->SetSize( 20, -1, w-10, -1 );
+
+ int m = 0;
+ wxNode *node = m_buttons.First();
+ while (node)
+ {
+ wxWindow *win = (wxWindow*)node->Data();
+ int x = (m*2+1)*space - 40 + 15;
+ win->Move( x, -1 );
+ node = node->Next();
+ m++;
+ }
+
+#if wxUSE_STATLINE
+ (void) new wxStaticLine( this, -1, wxPoint(0,y-20), wxSize(w+30, 5) );
+#endif
+
+ SetSize( w+30, y+40 );
- if (ok)
- ok->SetDefault();
+ Centre( wxBOTH );
- Layout();
- Centre(wxBOTH);
wxEndBusyCursor();
}
// Name: accel.cpp
// Purpose:
// Author: Robert Roebling
-// Id: $id$
+// Id: $id:$
// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#include "wx/accel.h"
-#include <ctype.h>
+#if wxUSE_ACCEL
-#ifdef __WXDEBUG__
-#ifdef NULL
-#undef NULL
-#endif
-#define NULL ((void*)0L)
-#endif
+#include <ctype.h>
//-----------------------------------------------------------------------------
// wxAcceleratorTable
return -1;
}
+#endif
{
gtk_set_locale();
- if (!wxOKlibc()) wxConv_current = &wxConv_local;
+ if (!wxOKlibc()) wxConvCurrent = &wxConvLocal;
gtk_init( &argc, &argv );
m_bitmap = (GdkBitmap*) NULL;
}
- wxFAIL_MSG( "TODO" );
+ wxFAIL_MSG( _T("TODO") );
return FALSE;
}
m_bitmap = (GdkBitmap*) NULL;
}
- wxFAIL_MSG( "not implemented" );
+ wxFAIL_MSG( _T("not implemented") );
return FALSE;
}
if (!bitmap.Ok()) return FALSE;
- wxCHECK_MSG( bitmap.GetBitmap(), FALSE, "Cannot create mask from colour bitmap" );
+ wxCHECK_MSG( bitmap.GetBitmap(), FALSE, _T("Cannot create mask from colour bitmap") );
m_bitmap = gdk_pixmap_new( (GdkWindow*) &gdk_root_parent, bitmap.GetWidth(), bitmap.GetHeight(), 1 );
#include "wx/bmpbuttn.h"
+#if wxUSE_BMPBUTTON
+
#include "gdk/gdk.h"
#include "gtk/gtk.h"
m_isSelected = FALSE;
SetBitmap();
}
+
+#endif
\ No newline at end of file
#include "wx/checkbox.h"
+#if wxUSE_CHECKBOX
+
#include "gdk/gdk.h"
#include "gtk/gtk.h"
gtk_widget_set_style( m_widgetLabel, m_widgetStyle );
}
+#endif
#include "wx/checklst.h"
+#if wxUSE_CHECKLISTBOX
+
#include "gdk/gdk.h"
#include "gtk/gtk.h"
GtkBin *bin = GTK_BIN( child->data );
GtkLabel *label = GTK_LABEL( bin->child );
- wxString str = wxString(label->label,*wxConv_current);
+ wxString str = wxString(label->label,*wxConvCurrent);
if (check == (str[1] == _T('X'))) return;
// FIXME
return 22;
}
+
+#endif
wxASSERT_MSG( label != NULL , _T("wxChoice: invalid label") );
- if (string == wxString(label->label,*wxConv_current))
+ if (string == wxString(label->label,*wxConvCurrent))
return count;
child = child->next;
wxASSERT_MSG( label != NULL , _T("wxChoice: invalid label") );
- return wxString(label->label,*wxConv_current);
+ return wxString(label->label,*wxConvCurrent);
}
child = child->next;
count++;
wxASSERT_MSG( label != NULL , _T("wxChoice: invalid label") );
- return wxString(label->label,*wxConv_current);
+ return wxString(label->label,*wxConvCurrent);
}
int wxChoice::Number() const
#endif
#include "wx/combobox.h"
+
+#if wxUSE_COMBOBOX
+
#include "wx/settings.h"
#include <wx/intl.h>
(window == GTK_COMBO(m_widget)->button->window ) );
}
+#endif
GTK_SIGNAL_FUNC(gtk_filedialog_ok_callback), (gpointer*)this );
// strange way to internationalize
- gtk_label_set( GTK_LABEL( GTK_BUTTON(sel->ok_button)->child ), wxConv_current->cWX2MB(_("OK")) );
+ gtk_label_set( GTK_LABEL( GTK_BUTTON(sel->ok_button)->child ), wxConvCurrent->cWX2MB(_("OK")) );
gtk_signal_connect( GTK_OBJECT(sel->cancel_button), "clicked",
GTK_SIGNAL_FUNC(gtk_filedialog_cancel_callback), (gpointer*)this );
// strange way to internationalize
- gtk_label_set( GTK_LABEL( GTK_BUTTON(sel->cancel_button)->child ), wxConv_current->cWX2MB(_("Cancel")) );
+ gtk_label_set( GTK_LABEL( GTK_BUTTON(sel->cancel_button)->child ), wxConvCurrent->cWX2MB(_("Cancel")) );
gtk_signal_connect( GTK_OBJECT(m_widget), "delete_event",
GTK_SIGNAL_FUNC(gtk_filedialog_delete_callback), (gpointer)this );
if (!facename.IsEmpty())
{
wxSprintf( wxBuffer, _T("-*-%s-*-*-normal-*-*-*-*-*-*-*-*-*"), facename.c_str() );
- GdkFont *test = gdk_font_load( wxConv_libc.cWX2MB(wxBuffer) );
+ GdkFont *test = gdk_font_load( wxConvCurrent->cWX2MB(wxBuffer) );
if (test)
{
gdk_font_unref( test );
wxSprintf( wxBuffer, _T("-*-%s-%s-%s-normal-*-*-%d-*-*-*-*-*-*"),
xfamily, xweight, xstyle, pointSize);
- return gdk_font_load( wxConv_libc.cWX2MB(wxBuffer) );
+ return gdk_font_load( wxConvCurrent->cWX2MB(wxBuffer) );
}
static GdkFont *wxLoadQueryNearestFont( int point_size, int family, int style, int weight,
#include "wx/control.h"
#include "wx/app.h"
#include "wx/menu.h"
+#if wxUSE_TOOLBAR
#include "wx/toolbar.h"
+#endif
+#if wxUSE_STATUSBAR
#include "wx/statusbr.h"
+#endif
#include "wx/dcclient.h"
#include "glib.h"
(*height) -= wxPLACE_HOLDER;
}
+#if wxUSE_STATUSBAR
/* status bar */
if (m_frameStatusBar) (*height) -= wxSTATUS_HEIGHT;
+#endif
+#if wxUSE_TOOLBAR
/* tool bar */
if (m_frameToolBar)
{
else
(*height) -= wxPLACE_HOLDER;
}
+#endif
/* mini edge */
(*height) -= m_miniEdge*2 + m_miniTitle;
height += wxPLACE_HOLDER;
}
+#if wxUSE_STATUSBAR
/* status bar */
if (m_frameStatusBar) height += wxSTATUS_HEIGHT;
+#endif
+#if wxUSE_TOOLBAR
/* tool bar */
if (m_frameToolBar)
{
else
height += wxPLACE_HOLDER;
}
+#endif
wxWindow::DoSetClientSize( width + m_miniEdge*2, height + m_miniEdge*2 + m_miniTitle );
}
client_area_y_offset += hh;
}
+#if wxUSE_TOOLBAR
if (m_frameToolBar)
{
int xx = m_miniEdge;
xx, yy, ww, hh );
client_area_y_offset += hh;
}
+#endif
int client_x = m_miniEdge;
int client_y = client_area_y_offset + m_miniEdge + m_miniTitle;
is no need to set the size or position of m_wxwindow. */
}
+#if wxUSE_STATUSBAR
if (m_frameStatusBar)
{
int xx = 0 + m_miniEdge;
m_frameStatusBar->m_widget,
xx, yy, ww, hh );
}
+#endif
/* we actually set the size of a frame here and no-where else */
gtk_widget_set_usize( m_widget, m_width, m_height );
DoMenuUpdates();
if (m_frameMenuBar) m_frameMenuBar->OnInternalIdle();
+#if wxUSE_TOOLBAR
if (m_frameToolBar) m_frameToolBar->OnInternalIdle();
+#endif
+#if wxUSE_STATUSBAR
if (m_frameStatusBar) m_frameStatusBar->OnInternalIdle();
+#endif
}
void wxFrame::OnCloseWindow( wxCloseEvent& WXUNUSED(event) )
#endif
#include "wx/gauge.h"
+
+#if wxUSE_GAUGE
+
#include "gdk/gdk.h"
#include "gtk/gtk.h"
gtk_widget_set_style( m_widget, m_widgetStyle );
}
+#endif
#pragma implementation "listbox.h"
#endif
-#include "wx/dynarray.h"
#include "wx/listbox.h"
+
+#if wxUSE_LISTBOX
+
+#include "wx/dynarray.h"
#include "wx/utils.h"
#include "wx/intl.h"
#include "wx/checklst.h"
// "key_press_event"
//-----------------------------------------------------------------------------
+#if wxUSE_CHECKLISTBOX
static gint
gtk_listbox_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_event, wxListBox *listbox )
{
if (gdk_event->keyval != ' ') return FALSE;
-#if wxUSE_CHECKLISTBOX
int sel = listbox->GetIndex( widget );
wxCheckListBox *clb = (wxCheckListBox *)listbox;
event.SetEventObject( listbox );
event.SetInt( sel );
listbox->GetEventHandler()->ProcessEvent( event );
-#endif // wxUSE_CHECKLISTBOX
return FALSE;
}
+#endif // wxUSE_CHECKLISTBOX
//-----------------------------------------------------------------------------
// "select" and "deselect"
GList *child = m_list->children;
while (child)
{
- gtk_tooltips_set_tip( tips, GTK_WIDGET( child->data ), wxConv_local.cWX2MB(tip), (gchar*) NULL );
+ gtk_tooltips_set_tip( tips, GTK_WIDGET( child->data ), wxConvLocal.cWX2MB(tip), (gchar*) NULL );
child = child->next;
}
}
child = child->next;
}
}
+
+#endif
\ No newline at end of file
#endif
#include "wx/mdi.h"
+
+#if wxUSE_MDI_ARCHITECTURE
+
#include "wx/dialog.h"
#include "wx/menu.h"
#include <wx/intl.h>
return TRUE;
}
+#endif
#endif
#include "wx/minifram.h"
+
+#if wxUSE_MINIFRAME
+
#include "wx/dcscreen.h"
#include "gtk/gtk.h"
return TRUE;
}
+
+#endif
#endif
#include "wx/notebook.h"
+
+#if wxUSE_NOTEBOOK
+
#include "wx/panel.h"
#include "wx/utils.h"
#include "wx/imaglist.h"
IMPLEMENT_DYNAMIC_CLASS(wxNotebookEvent, wxNotifyEvent)
+#endif
\ No newline at end of file
#endif
#include "wx/radiobox.h"
+
+#if wxUSE_RADIOBOX
+
#include "wx/dialog.h"
#include "wx/frame.h"
if (len > max_len) max_len = len;
gtk_myfixed_move( GTK_MYFIXED(m_parent->m_wxwindow), button, m_x+x, m_y+y );
- y += 20;
+ y += 22;
node = node->Next();
if (!node) break;
return FALSE;
}
+
+#endif
#endif
#include "wx/radiobut.h"
+
+#if wxUSE_RADIOBOX
+
#include "gdk/gdk.h"
#include "gtk/gtk.h"
gtk_widget_set_style( m_widget, m_widgetStyle );
gtk_widget_set_style( GTK_BUTTON(m_widget)->child, m_widgetStyle );
}
+
+#endif
#endif
#include "wx/scrolbar.h"
+
+#if wxUSE_SCROLLBAR
+
#include "wx/utils.h"
#include <math.h>
gtk_widget_set_style( m_widget, m_widgetStyle );
}
+#endif
#endif
#include "wx/slider.h"
+
+#if wxUSE_SLIDER
+
#include "wx/utils.h"
#include <math.h>
SetWidgetStyle();
gtk_widget_set_style( m_widget, m_widgetStyle );
}
+
+#endif
#endif
#include "wx/spinbutt.h"
+
+#ifdef wxUSE_SPINBTN
+
#include "wx/utils.h"
#include <math.h>
wxScrollEvent(commandType, id)
{
}
+
+#endif
\ No newline at end of file
#include "wx/statbmp.h"
+#if wxUSE_STATBMP
+
#include "gdk/gdk.h"
#include "gtk/gtk.h"
gtk_pixmap_set( GTK_PIXMAP(m_widget), m_bitmap.GetPixmap(), mask );
}
}
+
+#endif
#include "wx/statbox.h"
+#if wxUSE_STATBOX
+
#include "gdk/gdk.h"
#include "gtk/gtk.h"
SetWidgetStyle();
gtk_widget_set_style( m_widget, m_widgetStyle );
}
+
+#endif
#include "wx/statline.h"
+#if wxUSE_STATLINE
+
#include "gdk/gdk.h"
#include "gtk/gtk.h"
return TRUE;
}
+#endif
\ No newline at end of file
#endif
#include "wx/toolbar.h"
+
+#if wxUSE_TOOLBAR
+
#include "wx/frame.h"
#include "glib.h"
}
}
+#endif
{
gint len = gtk_text_get_length( GTK_TEXT(m_text) );
char *text = gtk_editable_get_chars( GTK_EDITABLE(m_text), 0, len );
- tmp = wxString(text,*wxConv_current);
+ tmp = wxString(text,*wxConvCurrent);
g_free( text );
}
else
{
- tmp = wxString(gtk_entry_get_text( GTK_ENTRY(m_text) ),*wxConv_current);
+ tmp = wxString(gtk_entry_get_text( GTK_ENTRY(m_text) ),*wxConvCurrent);
}
return tmp;
}
gtk_tooltips_set_delay( ss_tooltips, msecs );
}
+
#endif
if (create)
{
// Touch the file to create it
- FILE *fd = fopen(wxConv_file.cWX2MB(buf), "w");
+ FILE *fd = fopen(wxConvCurrent->cWX2MB(buf), "w");
if (fd) fclose(fd);
}
return buf;
else
{
(void)GetIniFile(filename, (wxChar *) NULL);
- serverDB = XrmGetFileDatabase(wxConv_file.cWX2MB(filename));
+ serverDB = XrmGetFileDatabase(wxConvCurrent->cWX2MB(filename));
}
if (serverDB)
XrmMergeDatabases(serverDB, &wxResourceDatabase);
#endif
#endif
#if wxUSE_UNICODE
- wxStrcat(environment, wxConv_libc.cMB2WX(hostbuf));
+ wxStrcat(environment, wxConvCurrent->cMB2WX(hostbuf));
#endif
}
- if ((homeDB = XrmGetFileDatabase(wxConv_file.cWX2MB(environment))))
+ if ((homeDB = XrmGetFileDatabase(wxConvCurrent->cWX2MB(environment))))
XrmMergeDatabases(homeDB, &wxResourceDatabase);
}
(void)GetResourcePath(nameBuffer, file, TRUE);
XrmDatabase database = (XrmDatabase)node->Data();
- XrmPutFileDatabase(database, wxConv_file.cWX2MB(nameBuffer));
+ XrmPutFileDatabase(database, wxConvCurrent->cWX2MB(nameBuffer));
XrmDestroyDatabase(database);
wxNode *next = node->Next();
// delete node;
if (node)
database = (XrmDatabase)node->Data();
else {
- database = XrmGetFileDatabase(wxConv_file.cWX2MB(buffer));
+ database = XrmGetFileDatabase(wxConvCurrent->cWX2MB(buffer));
wxLogTrace(wxTraceResAlloc, _T("Write: Number = %d"), wxTheResourceCache->Number());
wxTheResourceCache->Append(buffer, (wxObject *)database);
}
}
else
{
- database = XrmGetFileDatabase(wxConv_file.cWX2MB(buffer));
+ database = XrmGetFileDatabase(wxConvCurrent->cWX2MB(buffer));
wxLogTrace(wxTraceResAlloc, _T("Get: Number = %d"), wxTheResourceCache->Number());
wxTheResourceCache->Append(buffer, (wxObject *)database);
}
void wxWindow::ApplyToolTip( GtkTooltips *tips, const wxChar *tip )
{
- gtk_tooltips_set_tip( tips, GetConnectWidget(), wxConv_current->cWX2MB(tip), (gchar*) NULL );
+ gtk_tooltips_set_tip( tips, GetConnectWidget(), wxConvCurrent->cWX2MB(tip), (gchar*) NULL );
}
#endif // wxUSE_TOOLTIPS
// Name: accel.cpp
// Purpose:
// Author: Robert Roebling
-// Id: $id$
+// Id: $id:$
// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#include "wx/accel.h"
-#include <ctype.h>
+#if wxUSE_ACCEL
-#ifdef __WXDEBUG__
-#ifdef NULL
-#undef NULL
-#endif
-#define NULL ((void*)0L)
-#endif
+#include <ctype.h>
//-----------------------------------------------------------------------------
// wxAcceleratorTable
return -1;
}
+#endif
{
gtk_set_locale();
- if (!wxOKlibc()) wxConv_current = &wxConv_local;
+ if (!wxOKlibc()) wxConvCurrent = &wxConvLocal;
gtk_init( &argc, &argv );
m_bitmap = (GdkBitmap*) NULL;
}
- wxFAIL_MSG( "TODO" );
+ wxFAIL_MSG( _T("TODO") );
return FALSE;
}
m_bitmap = (GdkBitmap*) NULL;
}
- wxFAIL_MSG( "not implemented" );
+ wxFAIL_MSG( _T("not implemented") );
return FALSE;
}
if (!bitmap.Ok()) return FALSE;
- wxCHECK_MSG( bitmap.GetBitmap(), FALSE, "Cannot create mask from colour bitmap" );
+ wxCHECK_MSG( bitmap.GetBitmap(), FALSE, _T("Cannot create mask from colour bitmap") );
m_bitmap = gdk_pixmap_new( (GdkWindow*) &gdk_root_parent, bitmap.GetWidth(), bitmap.GetHeight(), 1 );
#include "wx/bmpbuttn.h"
+#if wxUSE_BMPBUTTON
+
#include "gdk/gdk.h"
#include "gtk/gtk.h"
m_isSelected = FALSE;
SetBitmap();
}
+
+#endif
\ No newline at end of file
#include "wx/checkbox.h"
+#if wxUSE_CHECKBOX
+
#include "gdk/gdk.h"
#include "gtk/gtk.h"
gtk_widget_set_style( m_widgetLabel, m_widgetStyle );
}
+#endif
#include "wx/checklst.h"
+#if wxUSE_CHECKLISTBOX
+
#include "gdk/gdk.h"
#include "gtk/gtk.h"
GtkBin *bin = GTK_BIN( child->data );
GtkLabel *label = GTK_LABEL( bin->child );
- wxString str = wxString(label->label,*wxConv_current);
+ wxString str = wxString(label->label,*wxConvCurrent);
if (check == (str[1] == _T('X'))) return;
// FIXME
return 22;
}
+
+#endif
wxASSERT_MSG( label != NULL , _T("wxChoice: invalid label") );
- if (string == wxString(label->label,*wxConv_current))
+ if (string == wxString(label->label,*wxConvCurrent))
return count;
child = child->next;
wxASSERT_MSG( label != NULL , _T("wxChoice: invalid label") );
- return wxString(label->label,*wxConv_current);
+ return wxString(label->label,*wxConvCurrent);
}
child = child->next;
count++;
wxASSERT_MSG( label != NULL , _T("wxChoice: invalid label") );
- return wxString(label->label,*wxConv_current);
+ return wxString(label->label,*wxConvCurrent);
}
int wxChoice::Number() const
#endif
#include "wx/combobox.h"
+
+#if wxUSE_COMBOBOX
+
#include "wx/settings.h"
#include <wx/intl.h>
(window == GTK_COMBO(m_widget)->button->window ) );
}
+#endif
GTK_SIGNAL_FUNC(gtk_filedialog_ok_callback), (gpointer*)this );
// strange way to internationalize
- gtk_label_set( GTK_LABEL( GTK_BUTTON(sel->ok_button)->child ), wxConv_current->cWX2MB(_("OK")) );
+ gtk_label_set( GTK_LABEL( GTK_BUTTON(sel->ok_button)->child ), wxConvCurrent->cWX2MB(_("OK")) );
gtk_signal_connect( GTK_OBJECT(sel->cancel_button), "clicked",
GTK_SIGNAL_FUNC(gtk_filedialog_cancel_callback), (gpointer*)this );
// strange way to internationalize
- gtk_label_set( GTK_LABEL( GTK_BUTTON(sel->cancel_button)->child ), wxConv_current->cWX2MB(_("Cancel")) );
+ gtk_label_set( GTK_LABEL( GTK_BUTTON(sel->cancel_button)->child ), wxConvCurrent->cWX2MB(_("Cancel")) );
gtk_signal_connect( GTK_OBJECT(m_widget), "delete_event",
GTK_SIGNAL_FUNC(gtk_filedialog_delete_callback), (gpointer)this );
if (!facename.IsEmpty())
{
wxSprintf( wxBuffer, _T("-*-%s-*-*-normal-*-*-*-*-*-*-*-*-*"), facename.c_str() );
- GdkFont *test = gdk_font_load( wxConv_libc.cWX2MB(wxBuffer) );
+ GdkFont *test = gdk_font_load( wxConvCurrent->cWX2MB(wxBuffer) );
if (test)
{
gdk_font_unref( test );
wxSprintf( wxBuffer, _T("-*-%s-%s-%s-normal-*-*-%d-*-*-*-*-*-*"),
xfamily, xweight, xstyle, pointSize);
- return gdk_font_load( wxConv_libc.cWX2MB(wxBuffer) );
+ return gdk_font_load( wxConvCurrent->cWX2MB(wxBuffer) );
}
static GdkFont *wxLoadQueryNearestFont( int point_size, int family, int style, int weight,
#include "wx/control.h"
#include "wx/app.h"
#include "wx/menu.h"
+#if wxUSE_TOOLBAR
#include "wx/toolbar.h"
+#endif
+#if wxUSE_STATUSBAR
#include "wx/statusbr.h"
+#endif
#include "wx/dcclient.h"
#include "glib.h"
(*height) -= wxPLACE_HOLDER;
}
+#if wxUSE_STATUSBAR
/* status bar */
if (m_frameStatusBar) (*height) -= wxSTATUS_HEIGHT;
+#endif
+#if wxUSE_TOOLBAR
/* tool bar */
if (m_frameToolBar)
{
else
(*height) -= wxPLACE_HOLDER;
}
+#endif
/* mini edge */
(*height) -= m_miniEdge*2 + m_miniTitle;
height += wxPLACE_HOLDER;
}
+#if wxUSE_STATUSBAR
/* status bar */
if (m_frameStatusBar) height += wxSTATUS_HEIGHT;
+#endif
+#if wxUSE_TOOLBAR
/* tool bar */
if (m_frameToolBar)
{
else
height += wxPLACE_HOLDER;
}
+#endif
wxWindow::DoSetClientSize( width + m_miniEdge*2, height + m_miniEdge*2 + m_miniTitle );
}
client_area_y_offset += hh;
}
+#if wxUSE_TOOLBAR
if (m_frameToolBar)
{
int xx = m_miniEdge;
xx, yy, ww, hh );
client_area_y_offset += hh;
}
+#endif
int client_x = m_miniEdge;
int client_y = client_area_y_offset + m_miniEdge + m_miniTitle;
is no need to set the size or position of m_wxwindow. */
}
+#if wxUSE_STATUSBAR
if (m_frameStatusBar)
{
int xx = 0 + m_miniEdge;
m_frameStatusBar->m_widget,
xx, yy, ww, hh );
}
+#endif
/* we actually set the size of a frame here and no-where else */
gtk_widget_set_usize( m_widget, m_width, m_height );
DoMenuUpdates();
if (m_frameMenuBar) m_frameMenuBar->OnInternalIdle();
+#if wxUSE_TOOLBAR
if (m_frameToolBar) m_frameToolBar->OnInternalIdle();
+#endif
+#if wxUSE_STATUSBAR
if (m_frameStatusBar) m_frameStatusBar->OnInternalIdle();
+#endif
}
void wxFrame::OnCloseWindow( wxCloseEvent& WXUNUSED(event) )
#endif
#include "wx/gauge.h"
+
+#if wxUSE_GAUGE
+
#include "gdk/gdk.h"
#include "gtk/gtk.h"
gtk_widget_set_style( m_widget, m_widgetStyle );
}
+#endif
#pragma implementation "listbox.h"
#endif
-#include "wx/dynarray.h"
#include "wx/listbox.h"
+
+#if wxUSE_LISTBOX
+
+#include "wx/dynarray.h"
#include "wx/utils.h"
#include "wx/intl.h"
#include "wx/checklst.h"
// "key_press_event"
//-----------------------------------------------------------------------------
+#if wxUSE_CHECKLISTBOX
static gint
gtk_listbox_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_event, wxListBox *listbox )
{
if (gdk_event->keyval != ' ') return FALSE;
-#if wxUSE_CHECKLISTBOX
int sel = listbox->GetIndex( widget );
wxCheckListBox *clb = (wxCheckListBox *)listbox;
event.SetEventObject( listbox );
event.SetInt( sel );
listbox->GetEventHandler()->ProcessEvent( event );
-#endif // wxUSE_CHECKLISTBOX
return FALSE;
}
+#endif // wxUSE_CHECKLISTBOX
//-----------------------------------------------------------------------------
// "select" and "deselect"
GList *child = m_list->children;
while (child)
{
- gtk_tooltips_set_tip( tips, GTK_WIDGET( child->data ), wxConv_local.cWX2MB(tip), (gchar*) NULL );
+ gtk_tooltips_set_tip( tips, GTK_WIDGET( child->data ), wxConvLocal.cWX2MB(tip), (gchar*) NULL );
child = child->next;
}
}
child = child->next;
}
}
+
+#endif
\ No newline at end of file
#endif
#include "wx/mdi.h"
+
+#if wxUSE_MDI_ARCHITECTURE
+
#include "wx/dialog.h"
#include "wx/menu.h"
#include <wx/intl.h>
return TRUE;
}
+#endif
#endif
#include "wx/minifram.h"
+
+#if wxUSE_MINIFRAME
+
#include "wx/dcscreen.h"
#include "gtk/gtk.h"
return TRUE;
}
+
+#endif
#endif
#include "wx/notebook.h"
+
+#if wxUSE_NOTEBOOK
+
#include "wx/panel.h"
#include "wx/utils.h"
#include "wx/imaglist.h"
IMPLEMENT_DYNAMIC_CLASS(wxNotebookEvent, wxNotifyEvent)
+#endif
\ No newline at end of file
#endif
#include "wx/radiobox.h"
+
+#if wxUSE_RADIOBOX
+
#include "wx/dialog.h"
#include "wx/frame.h"
if (len > max_len) max_len = len;
gtk_myfixed_move( GTK_MYFIXED(m_parent->m_wxwindow), button, m_x+x, m_y+y );
- y += 20;
+ y += 22;
node = node->Next();
if (!node) break;
return FALSE;
}
+
+#endif
#endif
#include "wx/radiobut.h"
+
+#if wxUSE_RADIOBOX
+
#include "gdk/gdk.h"
#include "gtk/gtk.h"
gtk_widget_set_style( m_widget, m_widgetStyle );
gtk_widget_set_style( GTK_BUTTON(m_widget)->child, m_widgetStyle );
}
+
+#endif
#endif
#include "wx/scrolbar.h"
+
+#if wxUSE_SCROLLBAR
+
#include "wx/utils.h"
#include <math.h>
gtk_widget_set_style( m_widget, m_widgetStyle );
}
+#endif
#endif
#include "wx/slider.h"
+
+#if wxUSE_SLIDER
+
#include "wx/utils.h"
#include <math.h>
SetWidgetStyle();
gtk_widget_set_style( m_widget, m_widgetStyle );
}
+
+#endif
#endif
#include "wx/spinbutt.h"
+
+#ifdef wxUSE_SPINBTN
+
#include "wx/utils.h"
#include <math.h>
wxScrollEvent(commandType, id)
{
}
+
+#endif
\ No newline at end of file
#include "wx/statbmp.h"
+#if wxUSE_STATBMP
+
#include "gdk/gdk.h"
#include "gtk/gtk.h"
gtk_pixmap_set( GTK_PIXMAP(m_widget), m_bitmap.GetPixmap(), mask );
}
}
+
+#endif
#include "wx/statbox.h"
+#if wxUSE_STATBOX
+
#include "gdk/gdk.h"
#include "gtk/gtk.h"
SetWidgetStyle();
gtk_widget_set_style( m_widget, m_widgetStyle );
}
+
+#endif
#include "wx/statline.h"
+#if wxUSE_STATLINE
+
#include "gdk/gdk.h"
#include "gtk/gtk.h"
return TRUE;
}
+#endif
\ No newline at end of file
#endif
#include "wx/toolbar.h"
+
+#if wxUSE_TOOLBAR
+
#include "wx/frame.h"
#include "glib.h"
}
}
+#endif
{
gint len = gtk_text_get_length( GTK_TEXT(m_text) );
char *text = gtk_editable_get_chars( GTK_EDITABLE(m_text), 0, len );
- tmp = wxString(text,*wxConv_current);
+ tmp = wxString(text,*wxConvCurrent);
g_free( text );
}
else
{
- tmp = wxString(gtk_entry_get_text( GTK_ENTRY(m_text) ),*wxConv_current);
+ tmp = wxString(gtk_entry_get_text( GTK_ENTRY(m_text) ),*wxConvCurrent);
}
return tmp;
}
gtk_tooltips_set_delay( ss_tooltips, msecs );
}
+
#endif
if (create)
{
// Touch the file to create it
- FILE *fd = fopen(wxConv_file.cWX2MB(buf), "w");
+ FILE *fd = fopen(wxConvCurrent->cWX2MB(buf), "w");
if (fd) fclose(fd);
}
return buf;
else
{
(void)GetIniFile(filename, (wxChar *) NULL);
- serverDB = XrmGetFileDatabase(wxConv_file.cWX2MB(filename));
+ serverDB = XrmGetFileDatabase(wxConvCurrent->cWX2MB(filename));
}
if (serverDB)
XrmMergeDatabases(serverDB, &wxResourceDatabase);
#endif
#endif
#if wxUSE_UNICODE
- wxStrcat(environment, wxConv_libc.cMB2WX(hostbuf));
+ wxStrcat(environment, wxConvCurrent->cMB2WX(hostbuf));
#endif
}
- if ((homeDB = XrmGetFileDatabase(wxConv_file.cWX2MB(environment))))
+ if ((homeDB = XrmGetFileDatabase(wxConvCurrent->cWX2MB(environment))))
XrmMergeDatabases(homeDB, &wxResourceDatabase);
}
(void)GetResourcePath(nameBuffer, file, TRUE);
XrmDatabase database = (XrmDatabase)node->Data();
- XrmPutFileDatabase(database, wxConv_file.cWX2MB(nameBuffer));
+ XrmPutFileDatabase(database, wxConvCurrent->cWX2MB(nameBuffer));
XrmDestroyDatabase(database);
wxNode *next = node->Next();
// delete node;
if (node)
database = (XrmDatabase)node->Data();
else {
- database = XrmGetFileDatabase(wxConv_file.cWX2MB(buffer));
+ database = XrmGetFileDatabase(wxConvCurrent->cWX2MB(buffer));
wxLogTrace(wxTraceResAlloc, _T("Write: Number = %d"), wxTheResourceCache->Number());
wxTheResourceCache->Append(buffer, (wxObject *)database);
}
}
else
{
- database = XrmGetFileDatabase(wxConv_file.cWX2MB(buffer));
+ database = XrmGetFileDatabase(wxConvCurrent->cWX2MB(buffer));
wxLogTrace(wxTraceResAlloc, _T("Get: Number = %d"), wxTheResourceCache->Number());
wxTheResourceCache->Append(buffer, (wxObject *)database);
}
void wxWindow::ApplyToolTip( GtkTooltips *tips, const wxChar *tip )
{
- gtk_tooltips_set_tip( tips, GetConnectWidget(), wxConv_current->cWX2MB(tip), (gchar*) NULL );
+ gtk_tooltips_set_tip( tips, GetConnectWidget(), wxConvCurrent->cWX2MB(tip), (gchar*) NULL );
}
#endif // wxUSE_TOOLTIPS
char *mb_argv[WXEXECUTE_NARGS];
while (argv[mb_argc]) {
- wxWX2MBbuf mb_arg = wxConv_libc.cWX2MB(argv[mb_argc]);
+ wxWX2MBbuf mb_arg = wxConvCurrent->cWX2MB(argv[mb_argc]);
mb_argv[mb_argc] = strdup(mb_arg);
mb_argc++;
}
}
if ((ptr = wxGetenv(_T("USER"))) != NULL || (ptr = wxGetenv(_T("LOGNAME"))) != NULL)
{
- who = getpwnam(wxConv_libc.cWX2MB(ptr));
+ who = getpwnam(wxConvCurrent->cWX2MB(ptr));
}
// We now make sure the the user exists!
}
#if wxUSE_UNICODE
- return who ? wxConv_libc.cMB2WX(who->pw_dir) : (wxMB2WXbuf)((wxChar*)NULL);
+ return who ? wxConvCurrent->cMB2WX(who->pw_dir) : (wxMB2WXbuf)((wxChar*)NULL);
#else
return who ? who->pw_dir : ((char*)NULL);
#endif
bool ok = uname(&uts) != -1;
if ( ok )
{
- wxStrncpy(buf, wxConv_libc.cMB2WX(uts.nodename), sz - 1);
+ wxStrncpy(buf, wxConvCurrent->cMB2WX(uts.nodename), sz - 1);
buf[sz] = _T('\0');
}
#elif defined(HAVE_GETHOSTNAME)
{
if ( !wxStrchr(buf, _T('.')) )
{
- struct hostent *host = gethostbyname(wxConv_libc.cWX2MB(buf));
+ struct hostent *host = gethostbyname(wxConvCurrent->cWX2MB(buf));
if ( !host )
{
wxLogSysError(_("Cannot get the official hostname"));
else
{
// the canonical name
- wxStrncpy(buf, wxConv_libc.cMB2WX(host->h_name), sz);
+ wxStrncpy(buf, wxConvCurrent->cMB2WX(host->h_name), sz);
}
}
//else: it's already a FQDN (BSD behaves this way)
*buf = _T('\0');
if ((who = getpwuid(getuid ())) != NULL)
{
- wxStrncpy (buf, wxConv_libc.cMB2WX(who->pw_name), sz - 1);
+ wxStrncpy (buf, wxConvCurrent->cMB2WX(who->pw_name), sz - 1);
return TRUE;
}
comma = strchr(who->pw_gecos, ',');
if (comma)
*comma = '\0'; // cut off non-name comment fields
- wxStrncpy (buf, wxConv_libc.cMB2WX(who->pw_gecos), sz - 1);
+ wxStrncpy (buf, wxConvCurrent->cMB2WX(who->pw_gecos), sz - 1);
return TRUE;
}