Added zillions of #if wxUSE_XXX

Removed cmndlgs usage of wxSizer and constraints
  Changed occurences of wxConv_xxx to wxConvXxxx and
    changed some wxConvLibc to wxConvCurrent
  Added Unicode tests to typetests (not finished)
  Compile fix for wxString in Unicode mode - we have
   to use the "experimental" printf then, I guess.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2794 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
1999-06-14 23:04:05 +00:00
parent 9f50f9f1a1
commit dcf924a345
119 changed files with 845 additions and 410 deletions

View File

@@ -15,11 +15,6 @@
/* wxWindows version (not used but required by autoheader) */
/* ------------------------------------------------------------------------ */
#if 0
#undef PACKAGE
#undef VERSION
#endif
/* needed for older automake? */
#undef WITH_SYMBOL_UNDERSCORE
@@ -579,4 +574,7 @@
@BOTTOM@
#undef PACKAGE
#undef VERSION
#endif /* __GTKSETUPH__ */

View File

@@ -15,6 +15,9 @@
#endif
#include "wx/defs.h"
#if wxUSE_ACCEL
#include "wx/object.h"
#include "wx/event.h"
@@ -103,3 +106,5 @@ class wxAcceleratorTable: public wxObject
};
#endif
#endif

View File

@@ -16,6 +16,9 @@
#endif
#include "wx/defs.h"
#if wxUSE_BMPBUTTON
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
@@ -91,4 +94,6 @@ public:
wxBitmap m_selected;
};
#endif
#endif // __BMPBUTTONH__

View File

@@ -16,6 +16,9 @@
#endif
#include "wx/defs.h"
#if wxUSE_CHECKBOX
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
@@ -73,4 +76,6 @@ public:
GtkWidget *m_widgetLabel;
};
#endif
#endif // __GTKCHECKBOXH__

View File

@@ -16,6 +16,9 @@
#endif
#include "wx/defs.h"
#if wxUSE_CHECKLISTBOX
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
@@ -53,4 +56,5 @@ public:
};
#endif
//__GTKCHECKLISTH__
#endif //__GTKCHECKLISTH__

View File

@@ -18,6 +18,8 @@
#include "wx/defs.h"
#if wxUSE_COMBOBOX
#include "wx/object.h"
#include "wx/control.h"
@@ -123,6 +125,8 @@ public:
DECLARE_EVENT_TABLE()
};
#endif
#endif
// __GTKCOMBOBOXH__

View File

@@ -113,8 +113,12 @@ public:
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;

View File

@@ -16,6 +16,9 @@
#endif
#include "wx/defs.h"
#if wxUSE_GAUGE
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
@@ -79,4 +82,6 @@ class wxGauge: public wxControl
bool m_useProgressBar;
};
#endif
#endif // __GTKGAUGEH__

View File

@@ -16,6 +16,9 @@
#endif
#include "wx/defs.h"
#if wxUSE_LISTBOX
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
@@ -125,4 +128,6 @@ public:
#endif // wxUSE_CHECKLISTBOX
};
#endif
#endif // __GTKLISTBOXH__

View File

@@ -119,22 +119,26 @@ class wxMDIChildFrame: public wxFrame
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; }

View File

@@ -15,6 +15,9 @@
#endif
#include "wx/defs.h"
#if wxUSE_MINIFRAME
#include "wx/object.h"
#include "wx/frame.h"
@@ -60,5 +63,7 @@ public:
int m_diffX,m_diffY;
};
#endif
#endif
// __GTKMINIFRAMEH__

View File

@@ -16,6 +16,9 @@
#endif
#include "wx/defs.h"
#if wxUSE_NOTEBOOK
#include "wx/object.h"
#include "wx/string.h"
#include "wx/control.h"
@@ -150,5 +153,7 @@ public:
DECLARE_EVENT_TABLE()
};
#endif
#endif
// __GTKNOTEBOOKH__

View File

@@ -16,6 +16,9 @@
#endif
#include "wx/defs.h"
#if wxUSE_RADIOBOX
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
@@ -104,4 +107,6 @@ public:
DECLARE_EVENT_TABLE()
};
#endif
#endif // __GTKRADIOBOXH__

View File

@@ -16,6 +16,9 @@
#endif
#include "wx/defs.h"
#if wxUSE_RADIOBOX
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
@@ -70,4 +73,6 @@ class wxRadioButton: public wxControl
GtkWidget* m_theOtherRadioButtton;
};
#endif
#endif // __GTKRADIOBUTTONH__

View File

@@ -16,6 +16,9 @@
#endif
#include "wx/defs.h"
#if wxUSE_SCROLLBAR
#include "wx/object.h"
#include "wx/control.h"
@@ -86,5 +89,7 @@ class wxScrollBar: public wxControl
float m_oldPos;
};
#endif
#endif
// __GTKSCROLLBARH__

View File

@@ -15,6 +15,9 @@
#endif
#include "wx/defs.h"
#if wxUSE_SLIDER
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
@@ -89,4 +92,6 @@ class wxSlider: public wxControl
};
#endif
#endif // __GTKSLIDERH__

View File

@@ -16,6 +16,9 @@
#endif
#include "wx/defs.h"
#ifdef wxUSE_SPINBTN
#include "wx/object.h"
#include "wx/control.h"
@@ -94,5 +97,7 @@ typedef void (wxEvtHandler::*wxSpinEventFunction)(wxSpinEvent&);
{ wxEVT_SCROLL_PAGEDOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func },\
{ wxEVT_SCROLL_THUMBTRACK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func },
#endif
#endif
// __GTKSPINBUTTH__

View File

@@ -16,6 +16,9 @@
#endif
#include "wx/defs.h"
#if wxUSE_STATBMP
#include "wx/object.h"
#include "wx/control.h"
#include "wx/bitmap.h"
@@ -57,4 +60,6 @@ class wxStaticBitmap: public wxControl
wxBitmap m_bitmap;
};
#endif
#endif // __GTKSTATICBITMAPH__

View File

@@ -16,6 +16,9 @@
#endif
#include "wx/defs.h"
#if wxUSE_STATBOX
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
@@ -56,4 +59,6 @@ class wxStaticBox: public wxControl
void ApplyWidgetStyle();
};
#endif
#endif // __GTKSTATICBOXH__

View File

@@ -16,6 +16,9 @@
#endif
#include "wx/defs.h"
#if wxUSE_STATLINE
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
@@ -52,4 +55,6 @@ class wxStaticLine: public wxControl
};
#endif
#endif // __GTKSTATICLINEH__

View File

@@ -15,6 +15,9 @@
#endif
#include "wx/defs.h"
#if wxUSE_TOOLBAR
#include "wx/control.h"
#include "wx/bitmap.h"
#include "wx/tbarbase.h"
@@ -119,5 +122,7 @@ class wxToolBar: public wxControl
bool m_hasToolAlready;
};
#endif
#endif
// __TBARGTKH__

View File

@@ -15,6 +15,9 @@
#endif
#include "wx/defs.h"
#if wxUSE_ACCEL
#include "wx/object.h"
#include "wx/event.h"
@@ -103,3 +106,5 @@ class wxAcceleratorTable: public wxObject
};
#endif
#endif

View File

@@ -16,6 +16,9 @@
#endif
#include "wx/defs.h"
#if wxUSE_BMPBUTTON
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
@@ -91,4 +94,6 @@ public:
wxBitmap m_selected;
};
#endif
#endif // __BMPBUTTONH__

View File

@@ -16,6 +16,9 @@
#endif
#include "wx/defs.h"
#if wxUSE_CHECKBOX
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
@@ -73,4 +76,6 @@ public:
GtkWidget *m_widgetLabel;
};
#endif
#endif // __GTKCHECKBOXH__

View File

@@ -16,6 +16,9 @@
#endif
#include "wx/defs.h"
#if wxUSE_CHECKLISTBOX
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
@@ -53,4 +56,5 @@ public:
};
#endif
//__GTKCHECKLISTH__
#endif //__GTKCHECKLISTH__

View File

@@ -18,6 +18,8 @@
#include "wx/defs.h"
#if wxUSE_COMBOBOX
#include "wx/object.h"
#include "wx/control.h"
@@ -123,6 +125,8 @@ public:
DECLARE_EVENT_TABLE()
};
#endif
#endif
// __GTKCOMBOBOXH__

View File

@@ -113,8 +113,12 @@ public:
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;

View File

@@ -16,6 +16,9 @@
#endif
#include "wx/defs.h"
#if wxUSE_GAUGE
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
@@ -79,4 +82,6 @@ class wxGauge: public wxControl
bool m_useProgressBar;
};
#endif
#endif // __GTKGAUGEH__

View File

@@ -16,6 +16,9 @@
#endif
#include "wx/defs.h"
#if wxUSE_LISTBOX
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
@@ -125,4 +128,6 @@ public:
#endif // wxUSE_CHECKLISTBOX
};
#endif
#endif // __GTKLISTBOXH__

View File

@@ -119,22 +119,26 @@ class wxMDIChildFrame: public wxFrame
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; }

View File

@@ -15,6 +15,9 @@
#endif
#include "wx/defs.h"
#if wxUSE_MINIFRAME
#include "wx/object.h"
#include "wx/frame.h"
@@ -60,5 +63,7 @@ public:
int m_diffX,m_diffY;
};
#endif
#endif
// __GTKMINIFRAMEH__

View File

@@ -16,6 +16,9 @@
#endif
#include "wx/defs.h"
#if wxUSE_NOTEBOOK
#include "wx/object.h"
#include "wx/string.h"
#include "wx/control.h"
@@ -150,5 +153,7 @@ public:
DECLARE_EVENT_TABLE()
};
#endif
#endif
// __GTKNOTEBOOKH__

View File

@@ -16,6 +16,9 @@
#endif
#include "wx/defs.h"
#if wxUSE_RADIOBOX
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
@@ -104,4 +107,6 @@ public:
DECLARE_EVENT_TABLE()
};
#endif
#endif // __GTKRADIOBOXH__

View File

@@ -16,6 +16,9 @@
#endif
#include "wx/defs.h"
#if wxUSE_RADIOBOX
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
@@ -70,4 +73,6 @@ class wxRadioButton: public wxControl
GtkWidget* m_theOtherRadioButtton;
};
#endif
#endif // __GTKRADIOBUTTONH__

View File

@@ -16,6 +16,9 @@
#endif
#include "wx/defs.h"
#if wxUSE_SCROLLBAR
#include "wx/object.h"
#include "wx/control.h"
@@ -86,5 +89,7 @@ class wxScrollBar: public wxControl
float m_oldPos;
};
#endif
#endif
// __GTKSCROLLBARH__

View File

@@ -15,6 +15,9 @@
#endif
#include "wx/defs.h"
#if wxUSE_SLIDER
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
@@ -89,4 +92,6 @@ class wxSlider: public wxControl
};
#endif
#endif // __GTKSLIDERH__

View File

@@ -16,6 +16,9 @@
#endif
#include "wx/defs.h"
#ifdef wxUSE_SPINBTN
#include "wx/object.h"
#include "wx/control.h"
@@ -94,5 +97,7 @@ typedef void (wxEvtHandler::*wxSpinEventFunction)(wxSpinEvent&);
{ wxEVT_SCROLL_PAGEDOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func },\
{ wxEVT_SCROLL_THUMBTRACK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func },
#endif
#endif
// __GTKSPINBUTTH__

View File

@@ -16,6 +16,9 @@
#endif
#include "wx/defs.h"
#if wxUSE_STATBMP
#include "wx/object.h"
#include "wx/control.h"
#include "wx/bitmap.h"
@@ -57,4 +60,6 @@ class wxStaticBitmap: public wxControl
wxBitmap m_bitmap;
};
#endif
#endif // __GTKSTATICBITMAPH__

View File

@@ -16,6 +16,9 @@
#endif
#include "wx/defs.h"
#if wxUSE_STATBOX
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
@@ -56,4 +59,6 @@ class wxStaticBox: public wxControl
void ApplyWidgetStyle();
};
#endif
#endif // __GTKSTATICBOXH__

View File

@@ -16,6 +16,9 @@
#endif
#include "wx/defs.h"
#if wxUSE_STATLINE
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
@@ -52,4 +55,6 @@ class wxStaticLine: public wxControl
};
#endif
#endif // __GTKSTATICLINEH__

View File

@@ -15,6 +15,9 @@
#endif
#include "wx/defs.h"
#if wxUSE_TOOLBAR
#include "wx/control.h"
#include "wx/bitmap.h"
#include "wx/tbarbase.h"
@@ -119,5 +122,7 @@ class wxToolBar: public wxControl
bool m_hasToolAlready;
};
#endif
#endif
// __TBARGTKH__

View File

@@ -198,7 +198,6 @@ class WXDLLEXPORT wxMBConv
#endif
};
WXDLLEXPORT_DATA(extern wxMBConv) wxConvLibc;
#define wxConv_libc wxConvLibc
#define wxANOTHER_MBCONV(type) \
class type : public wxMBConv { \
@@ -208,14 +207,11 @@ 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
@@ -260,10 +256,7 @@ public:
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

View File

@@ -48,7 +48,7 @@ MyCanvas *myCanvas = (MyCanvas *) NULL;
bool MyApp::OnInit(void)
{
#if defined(__WXGTK__) && defined(wxUSE_UNICODE)
wxConvCurrent = &wxConvLocal;
wxConvCurrent = &wxConvLibc;
#endif
m_canvasTextColour = wxColour("BLACK");

View File

@@ -44,6 +44,9 @@ BEGIN_EVENT_TABLE(MyApp, wxApp)
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)
@@ -64,6 +67,9 @@ 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;
@@ -80,6 +86,32 @@ bool MyApp::OnInit(void)
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();
@@ -96,19 +128,19 @@ void MyApp::DoByteOrderDemo(wxCommandEvent& WXUNUSED(event))
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 );
}
@@ -287,7 +319,7 @@ void MyApp::DoVariantDemo(wxCommandEvent& WXUNUSED(event) )
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";

View File

@@ -26,6 +26,9 @@ public:
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; }
@@ -62,6 +65,7 @@ public:
#define TYPES_TIME 104
#define TYPES_VARIANT 105
#define TYPES_BYTEORDER 106
#define TYPES_UNICODE 107
#endif
// _WX_TYPETEST_H_

View File

@@ -160,7 +160,7 @@ bool wxFile::Exists(const wxChar *name)
{
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) &&

View File

@@ -1076,8 +1076,8 @@ bool wxDirExists(const wxString& dir)
// 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');
@@ -1444,7 +1444,7 @@ wxChar *wxGetWorkingDirectory(wxChar *buf, int sz)
}
#if wxUSE_UNICODE
else {
wxConv_file.MB2WC(buf, cbuf, sz);
wxConvFile.MB2WC(buf, cbuf, sz);
delete [] cbuf;
}
#endif

View File

@@ -517,7 +517,7 @@ const wxMB2WXbuf wxLocale::GetString(const wxChar *szOrigString,
return szDomain;
const char *pszTrans = NULL;
const wxWX2MBbuf szOrgString = wxConv_libc.cWX2MB(szOrigString);
const wxWX2MBbuf szOrgString = wxConvCurrent->cWX2MB(szOrigString);
wxMsgCatalog *pMsgCat;
if ( szDomain != NULL ) {
@@ -564,7 +564,7 @@ const wxMB2WXbuf wxLocale::GetString(const wxChar *szOrigString,
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

View File

@@ -405,7 +405,7 @@ wxLogStream::wxLogStream(ostream *ostr)
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
@@ -972,7 +972,7 @@ const wxChar *wxSysErrorMsg(unsigned long nErrCode)
#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);

View File

@@ -1621,9 +1621,9 @@ bool wxResourceReadOneResource(FILE *fd, wxExprDatabase& db, bool *eof, wxResour
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);
@@ -1644,7 +1644,7 @@ bool wxResourceReadOneResource(FILE *fd, wxExprDatabase& db, bool *eof, wxResour
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;
@@ -1662,7 +1662,7 @@ bool wxResourceReadOneResource(FILE *fd, wxExprDatabase& db, bool *eof, wxResour
{
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;
@@ -2525,9 +2525,9 @@ bool wxResourceParseIncludeFile(const wxString& f, wxResourceTable *table)
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);
@@ -2698,9 +2698,9 @@ bool wxResourceReadOneResourceString(char *s, wxExprDatabase& db, bool *eof, wxR
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);
@@ -2743,7 +2743,7 @@ bool wxResourceReadOneResourceString(char *s, wxExprDatabase& db, bool *eof, wxR
{
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;

View File

@@ -94,6 +94,13 @@ extern const wxChar WXDLLEXPORT *g_szNul = &g_strEmpty.dummy;
// 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.
@@ -2189,7 +2196,6 @@ static void wxLoadCharacterSets(void)
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();

View File

@@ -86,6 +86,7 @@ bool wxGenericValidator::TransferToWindow(void)
return FALSE;
// bool controls
#if wxUSE_CHECKBOX
if (m_validatorWindow->IsKindOf(CLASSINFO(wxCheckBox)) )
{
wxCheckBox* pControl = (wxCheckBox*) m_validatorWindow;
@@ -94,8 +95,10 @@ bool wxGenericValidator::TransferToWindow(void)
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)
@@ -103,9 +106,11 @@ bool wxGenericValidator::TransferToWindow(void)
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)
@@ -114,7 +119,10 @@ bool wxGenericValidator::TransferToWindow(void)
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)
@@ -123,7 +131,10 @@ bool wxGenericValidator::TransferToWindow(void)
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)
@@ -131,9 +142,11 @@ bool wxGenericValidator::TransferToWindow(void)
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)
@@ -141,10 +154,11 @@ bool wxGenericValidator::TransferToWindow(void)
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)
@@ -152,8 +166,9 @@ bool wxGenericValidator::TransferToWindow(void)
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)
@@ -162,6 +177,7 @@ bool wxGenericValidator::TransferToWindow(void)
return TRUE;
}
}
#endif
else if (m_validatorWindow->IsKindOf(CLASSINFO(wxChoice)) )
{
wxChoice* pControl = (wxChoice*) m_validatorWindow;
@@ -188,12 +204,13 @@ bool wxGenericValidator::TransferToWindow(void)
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)
@@ -210,9 +227,11 @@ bool wxGenericValidator::TransferToWindow(void)
}
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)
@@ -227,10 +246,12 @@ bool wxGenericValidator::TransferToWindow(void)
pControl->SetSelection(m_pArrayInt->Item(u));
return TRUE;
}
}
} else
#endif
// unrecognized control, or bad pointer
return FALSE;
return FALSE;
}
// Called to transfer data to the window
@@ -240,6 +261,7 @@ bool wxGenericValidator::TransferFromWindow(void)
return FALSE;
// bool controls
#if wxUSE_CHECKBOX
if (m_validatorWindow->IsKindOf(CLASSINFO(wxCheckBox)) )
{
wxCheckBox* pControl = (wxCheckBox*) m_validatorWindow;
@@ -248,8 +270,10 @@ bool wxGenericValidator::TransferFromWindow(void)
*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)
@@ -257,9 +281,11 @@ bool wxGenericValidator::TransferFromWindow(void)
*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)
@@ -267,8 +293,10 @@ bool wxGenericValidator::TransferFromWindow(void)
*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)
@@ -276,8 +304,10 @@ bool wxGenericValidator::TransferFromWindow(void)
*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)
@@ -285,9 +315,11 @@ bool wxGenericValidator::TransferFromWindow(void)
*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)
@@ -295,10 +327,11 @@ bool wxGenericValidator::TransferFromWindow(void)
*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)
@@ -307,7 +340,9 @@ bool wxGenericValidator::TransferFromWindow(void)
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)
@@ -315,8 +350,9 @@ bool wxGenericValidator::TransferFromWindow(void)
*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)
@@ -324,8 +360,8 @@ bool wxGenericValidator::TransferFromWindow(void)
*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)
@@ -333,8 +369,8 @@ bool wxGenericValidator::TransferFromWindow(void)
*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)
@@ -342,12 +378,13 @@ bool wxGenericValidator::TransferFromWindow(void)
*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)
@@ -363,9 +400,11 @@ bool wxGenericValidator::TransferFromWindow(void)
}
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)
@@ -379,10 +418,12 @@ bool wxGenericValidator::TransferFromWindow(void)
m_pArrayInt->Add(i);
return TRUE;
}
}
} else
#endif
// unrecognized control, or bad pointer
return FALSE;
return FALSE;
}
/*

View File

@@ -190,7 +190,7 @@ WXDLLEXPORT wxChar * wxStrtok(wxChar *psz, const wxChar *delim, wxChar **save_pt
#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;
}
@@ -272,7 +272,7 @@ int WXDLLEXPORT wxVsscanf(const wxChar *buf, const wxChar *fmt, va_list argptr)
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
@@ -280,19 +280,19 @@ int WXDLLEXPORT wxVsscanf(const wxChar *buf, const wxChar *fmt, va_list argptr)
#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)
@@ -302,7 +302,7 @@ 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);
@@ -315,7 +315,7 @@ wxChar * WXDLLEXPORT wxGetenv(const wxChar *name)
int WXDLLEXPORT wxSystem(const wxChar *psz)
{
return system(wxConv_libc.cWX2MB(psz));
return system(wxConvLibc.cWX2MB(psz));
}
#endif

View File

@@ -733,7 +733,7 @@ void wxExpr::WriteExpr(ostream& stream) // Write as any other subexpression
{
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++)
{
@@ -749,7 +749,7 @@ void wxExpr::WriteExpr(ostream& stream) // Write as any other subexpression
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;
@@ -1195,7 +1195,7 @@ char *wxmake_string(char *str)
{
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 */

View File

@@ -20,54 +20,60 @@
#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/listbox.h"
#include "wx/stattext.h"
#include "wx/layout.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;
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("");
}
delete[] copyMessage;
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),
@@ -75,11 +81,9 @@ wxString wxGetSingleChoice( const wxString& message, const wxString& caption, in
{
wxSingleChoiceDialog dialog(parent, message, caption, n, choices);
if ( dialog.ShowModal() == wxID_OK )
{
return dialog.GetStringSelection();
}
else
return "";
return _T("");
}
// Overloaded for backward compatibility
@@ -107,9 +111,7 @@ int wxGetSingleChoiceIndex( const wxString& message, const wxString& caption, in
{
wxSingleChoiceDialog dialog(parent, message, caption, n, choices);
if ( dialog.ShowModal() == wxID_OK )
{
return dialog.GetSelection();
}
else
return -1;
}
@@ -121,11 +123,8 @@ int wxGetSingleChoiceIndex( const wxString& message, const wxString& caption, in
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;
@@ -139,9 +138,7 @@ wxChar *wxGetSingleChoiceData( const wxString& message, const wxString& caption,
{
wxSingleChoiceDialog dialog(parent, message, caption, n, choices, client_data);
if ( dialog.ShowModal() == wxID_OK )
{
return dialog.GetSelectionClientData();
}
else
return NULL;
}
@@ -243,70 +240,37 @@ bool wxSingleChoiceDialog::Create( wxWindow *WXUNUSED(parent), const wxString& m
wxBeginBusyCursor();
wxSizer *topSizer = new wxSizer(this, wxSizerShrink);
topSizer->SetBorder(10, 10);
wxSize message_size( wxSplitMessage2( message, this ) );
wxRowColSizer *messageSizer = new wxRowColSizer(topSizer, wxSIZER_COLS, 100);
messageSizer->SetName(_T("messageSizer"));
wxButton *ok = (wxButton *) NULL;
wxButton *cancel = (wxButton *) NULL;
wxList m_buttons;
// bool centre = ((style & wxCENTRE) == wxCENTRE);
int y = message_size.y + 15;
wxList messageList;
wxSplitMessage2(message, &messageList, this, messageSizer);
int listbox_height = wxMin( 160, n*20 );
// 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 )
{
int i;
for ( i = 0; i < n; i++)
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)
{
for (int i = 0; i < n; i++)
listBox->SetClientData(i, clientData[i]);
}
y += listbox_height + 35;
if (style & wxOK)
{
ok = new wxButton( this, wxID_OK, _("OK"), wxPoint(-1,y), wxSize(80,-1) );
m_buttons.Append( ok );
}
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 & 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)
@@ -315,8 +279,30 @@ bool wxSingleChoiceDialog::Create( wxWindow *WXUNUSED(parent), const wxString& m
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();
@@ -360,5 +346,3 @@ void wxSingleChoiceDialog::OnListBoxDClick(wxCommandEvent& WXUNUSED(event))
EndModal(wxID_OK);
}
#endif // wxUSE_CONSTRAINTS

View File

@@ -1332,7 +1332,7 @@ void wxPostScriptDC::EndDoc ()
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";
@@ -1342,15 +1342,15 @@ void wxPostScriptDC::EndDoc ()
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>

View File

@@ -21,13 +21,11 @@
#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>
@@ -35,15 +33,12 @@
#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;
@@ -95,6 +90,8 @@ wxGenericMessageDialog::wxGenericMessageDialog( wxWindow *parent, const wxString
{
m_dialogStyle = style;
wxBeginBusyCursor();
wxSize message_size( wxSplitMessage2( message, this ) );
wxButton *ok = (wxButton *) NULL;
@@ -158,13 +155,15 @@ wxGenericMessageDialog::wxGenericMessageDialog( wxWindow *parent, const wxString
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))

View File

@@ -173,8 +173,8 @@ void wxGenericPrintDialog::Init(wxWindow * WXUNUSED(parent))
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();
@@ -431,8 +431,8 @@ void wxGenericPrintSetupDialog::Init(wxPrintData* data)
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();

View File

@@ -535,7 +535,7 @@ void wxPropertyValue::WritePropertyType(ostream& stream) // Write as any othe
{
// 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++)
{

View File

@@ -21,19 +21,58 @@
#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
@@ -44,39 +83,6 @@ END_EVENT_TABLE()
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)
@@ -86,67 +92,61 @@ wxTextEntryDialog::wxTextEntryDialog(wxWindow *parent, const wxString& message,
wxBeginBusyCursor();
wxSizer *topSizer = new wxSizer(this, wxSizerShrink);
topSizer->SetBorder(10, 10);
wxSize message_size( wxSplitMessage2( message, this ) );
wxRowColSizer *messageSizer = new wxRowColSizer(topSizer, wxSIZER_COLS, 100);
messageSizer->SetName("messageSizer");
wxButton *ok = (wxButton *) NULL;
wxButton *cancel = (wxButton *) NULL;
wxList m_buttons;
// bool centre = ((style & wxCENTRE) == wxCENTRE);
int y = message_size.y + 15;
wxList messageList;
wxSplitMessage2(message, &messageList, this, messageSizer);
wxTextCtrl *textCtrl = new wxTextCtrl(this, wxID_TEXT, value, wxPoint(-1, y), wxSize(350, -1));
// Insert a spacer
wxSpacingSizer *spacingSizer = new wxSpacingSizer(topSizer, wxBelow, messageSizer, 10);
y += 65;
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 & 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->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 );
Centre( wxBOTH );
Layout();
Centre(wxBOTH);
wxEndBusyCursor();
}

View File

@@ -2,7 +2,7 @@
// Name: accel.cpp
// Purpose:
// Author: Robert Roebling
// Id: $id$
// Id: $id:$
// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@@ -13,14 +13,9 @@
#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
@@ -94,3 +89,4 @@ int wxAcceleratorTable::GetCommand( wxKeyEvent &event )
return -1;
}
#endif

View File

@@ -662,7 +662,7 @@ int wxEntry( int argc, char *argv[] )
{
gtk_set_locale();
if (!wxOKlibc()) wxConv_current = &wxConv_local;
if (!wxOKlibc()) wxConvCurrent = &wxConvLocal;
gtk_init( &argc, &argv );

View File

@@ -59,7 +59,7 @@ bool wxMask::Create( const wxBitmap& bitmap, const wxColour& colour )
m_bitmap = (GdkBitmap*) NULL;
}
wxFAIL_MSG( "TODO" );
wxFAIL_MSG( _T("TODO") );
return FALSE;
}
@@ -72,7 +72,7 @@ bool wxMask::Create( const wxBitmap& WXUNUSED(bitmap), int WXUNUSED(paletteIndex
m_bitmap = (GdkBitmap*) NULL;
}
wxFAIL_MSG( "not implemented" );
wxFAIL_MSG( _T("not implemented") );
return FALSE;
}
@@ -87,7 +87,7 @@ bool wxMask::Create( const wxBitmap& bitmap )
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 );

View File

@@ -13,6 +13,8 @@
#include "wx/bmpbuttn.h"
#if wxUSE_BMPBUTTON
#include "gdk/gdk.h"
#include "gtk/gtk.h"
@@ -309,3 +311,5 @@ void wxBitmapButton::EndSelect()
m_isSelected = FALSE;
SetBitmap();
}
#endif

View File

@@ -14,6 +14,8 @@
#include "wx/checkbox.h"
#if wxUSE_CHECKBOX
#include "gdk/gdk.h"
#include "gtk/gtk.h"
@@ -184,3 +186,4 @@ void wxCheckBox::ApplyWidgetStyle()
gtk_widget_set_style( m_widgetLabel, m_widgetStyle );
}
#endif

View File

@@ -13,6 +13,8 @@
#include "wx/checklst.h"
#if wxUSE_CHECKLISTBOX
#include "gdk/gdk.h"
#include "gtk/gtk.h"
@@ -69,7 +71,7 @@ void wxCheckListBox::Check( int index, bool check )
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;
@@ -91,3 +93,5 @@ int wxCheckListBox::GetItemHeight() const
// FIXME
return 22;
}
#endif

View File

@@ -251,7 +251,7 @@ int wxChoice::FindString( const wxString &string ) const
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;
@@ -304,7 +304,7 @@ wxString wxChoice::GetString( int n ) const
wxASSERT_MSG( label != NULL , _T("wxChoice: invalid label") );
return wxString(label->label,*wxConv_current);
return wxString(label->label,*wxConvCurrent);
}
child = child->next;
count++;
@@ -323,7 +323,7 @@ wxString wxChoice::GetStringSelection() const
wxASSERT_MSG( label != NULL , _T("wxChoice: invalid label") );
return wxString(label->label,*wxConv_current);
return wxString(label->label,*wxConvCurrent);
}
int wxChoice::Number() const

View File

@@ -12,6 +12,9 @@
#endif
#include "wx/combobox.h"
#if wxUSE_COMBOBOX
#include "wx/settings.h"
#include <wx/intl.h>
@@ -625,3 +628,4 @@ bool wxComboBox::IsOwnGtkWindow( GdkWindow *window )
(window == GTK_COMBO(m_widget)->button->window ) );
}
#endif

View File

@@ -145,13 +145,13 @@ wxFileDialog::wxFileDialog( wxWindow *parent, const wxString& message,
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 );

View File

@@ -401,7 +401,7 @@ static GdkFont*wxLoadQueryFont( int pointSize, int family, int style, int weight
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 );
@@ -427,7 +427,7 @@ static GdkFont*wxLoadQueryFont( int pointSize, int family, int style, int weight
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,

View File

@@ -16,8 +16,12 @@
#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"
@@ -560,9 +564,12 @@ void wxFrame::DoGetClientSize( int *width, int *height ) const
(*height) -= wxPLACE_HOLDER;
}
#if wxUSE_STATUSBAR
/* status bar */
if (m_frameStatusBar) (*height) -= wxSTATUS_HEIGHT;
#endif
#if wxUSE_TOOLBAR
/* tool bar */
if (m_frameToolBar)
{
@@ -575,6 +582,7 @@ void wxFrame::DoGetClientSize( int *width, int *height ) const
else
(*height) -= wxPLACE_HOLDER;
}
#endif
/* mini edge */
(*height) -= m_miniEdge*2 + m_miniTitle;
@@ -598,9 +606,12 @@ void wxFrame::DoSetClientSize( int width, int height )
height += wxPLACE_HOLDER;
}
#if wxUSE_STATUSBAR
/* status bar */
if (m_frameStatusBar) height += wxSTATUS_HEIGHT;
#endif
#if wxUSE_TOOLBAR
/* tool bar */
if (m_frameToolBar)
{
@@ -613,6 +624,7 @@ void wxFrame::DoSetClientSize( int width, int height )
else
height += wxPLACE_HOLDER;
}
#endif
wxWindow::DoSetClientSize( width + m_miniEdge*2, height + m_miniEdge*2 + m_miniTitle );
}
@@ -674,6 +686,7 @@ void wxFrame::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y), int width, int height
client_area_y_offset += hh;
}
#if wxUSE_TOOLBAR
if (m_frameToolBar)
{
int xx = m_miniEdge;
@@ -697,6 +710,7 @@ void wxFrame::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y), int width, int height
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;
@@ -712,6 +726,7 @@ void wxFrame::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y), int width, int height
is no need to set the size or position of m_wxwindow. */
}
#if wxUSE_STATUSBAR
if (m_frameStatusBar)
{
int xx = 0 + m_miniEdge;
@@ -726,6 +741,7 @@ void wxFrame::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y), int width, int height
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 );
@@ -764,8 +780,12 @@ void wxFrame::OnInternalIdle()
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) )

View File

@@ -12,6 +12,9 @@
#endif
#include "wx/gauge.h"
#if wxUSE_GAUGE
#include "gdk/gdk.h"
#include "gtk/gtk.h"
@@ -78,3 +81,4 @@ void wxGauge::ApplyWidgetStyle()
gtk_widget_set_style( m_widget, m_widgetStyle );
}
#endif

View File

@@ -12,8 +12,11 @@
#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"
@@ -159,6 +162,7 @@ gtk_listbox_button_press_callback( GtkWidget *widget, GdkEventButton *gdk_event,
// "key_press_event"
//-----------------------------------------------------------------------------
#if wxUSE_CHECKLISTBOX
static gint
gtk_listbox_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_event, wxListBox *listbox )
{
@@ -170,7 +174,6 @@ gtk_listbox_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_event, wxLis
if (gdk_event->keyval != ' ') return FALSE;
#if wxUSE_CHECKLISTBOX
int sel = listbox->GetIndex( widget );
wxCheckListBox *clb = (wxCheckListBox *)listbox;
@@ -181,10 +184,10 @@ gtk_listbox_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_event, wxLis
event.SetEventObject( listbox );
event.SetInt( sel );
listbox->GetEventHandler()->ProcessEvent( event );
#endif // wxUSE_CHECKLISTBOX
return FALSE;
}
#endif // wxUSE_CHECKLISTBOX
//-----------------------------------------------------------------------------
// "select" and "deselect"
@@ -854,7 +857,7 @@ void wxListBox::ApplyToolTip( GtkTooltips *tips, const wxChar *tip )
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;
}
}
@@ -940,3 +943,5 @@ void wxListBox::ApplyWidgetStyle()
child = child->next;
}
}
#endif

View File

@@ -12,6 +12,9 @@
#endif
#include "wx/mdi.h"
#if wxUSE_MDI_ARCHITECTURE
#include "wx/dialog.h"
#include "wx/menu.h"
#include <wx/intl.h>
@@ -421,3 +424,4 @@ bool wxMDIClientWindow::CreateClient( wxMDIParentFrame *parent, long style )
return TRUE;
}
#endif

View File

@@ -12,6 +12,9 @@
#endif
#include "wx/minifram.h"
#if wxUSE_MINIFRAME
#include "wx/dcscreen.h"
#include "gtk/gtk.h"
@@ -318,3 +321,5 @@ bool wxMiniFrame::Create( wxWindow *parent, wxWindowID id, const wxString &title
return TRUE;
}
#endif

View File

@@ -12,6 +12,9 @@
#endif
#include "wx/notebook.h"
#if wxUSE_NOTEBOOK
#include "wx/panel.h"
#include "wx/utils.h"
#include "wx/imaglist.h"
@@ -623,3 +626,4 @@ bool wxNotebook::IsOwnGtkWindow( GdkWindow *window )
IMPLEMENT_DYNAMIC_CLASS(wxNotebookEvent, wxNotifyEvent)
#endif

View File

@@ -12,6 +12,9 @@
#endif
#include "wx/radiobox.h"
#if wxUSE_RADIOBOX
#include "wx/dialog.h"
#include "wx/frame.h"
@@ -180,7 +183,7 @@ wxSize wxRadioBox::LayoutItems()
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;
@@ -516,3 +519,5 @@ bool wxRadioBox::IsOwnGtkWindow( GdkWindow *window )
return FALSE;
}
#endif

View File

@@ -13,6 +13,9 @@
#endif
#include "wx/radiobut.h"
#if wxUSE_RADIOBOX
#include "gdk/gdk.h"
#include "gtk/gtk.h"
@@ -152,3 +155,5 @@ void wxRadioButton::ApplyWidgetStyle()
gtk_widget_set_style( m_widget, m_widgetStyle );
gtk_widget_set_style( GTK_BUTTON(m_widget)->child, m_widgetStyle );
}
#endif

View File

@@ -13,6 +13,9 @@
#endif
#include "wx/scrolbar.h"
#if wxUSE_SCROLLBAR
#include "wx/utils.h"
#include <math.h>
@@ -307,3 +310,4 @@ void wxScrollBar::ApplyWidgetStyle()
gtk_widget_set_style( m_widget, m_widgetStyle );
}
#endif

View File

@@ -12,6 +12,9 @@
#endif
#include "wx/slider.h"
#if wxUSE_SLIDER
#include "wx/utils.h"
#include <math.h>
@@ -289,3 +292,5 @@ void wxSlider::ApplyWidgetStyle()
SetWidgetStyle();
gtk_widget_set_style( m_widget, m_widgetStyle );
}
#endif

View File

@@ -13,6 +13,9 @@
#endif
#include "wx/spinbutt.h"
#ifdef wxUSE_SPINBTN
#include "wx/utils.h"
#include <math.h>
@@ -208,3 +211,5 @@ wxSpinEvent::wxSpinEvent(wxEventType commandType, int id):
wxScrollEvent(commandType, id)
{
}
#endif

View File

@@ -13,6 +13,8 @@
#include "wx/statbmp.h"
#if wxUSE_STATBMP
#include "gdk/gdk.h"
#include "gtk/gtk.h"
@@ -80,3 +82,5 @@ void wxStaticBitmap::SetBitmap( const wxBitmap &bitmap )
gtk_pixmap_set( GTK_PIXMAP(m_widget), m_bitmap.GetPixmap(), mask );
}
}
#endif

View File

@@ -13,6 +13,8 @@
#include "wx/statbox.h"
#if wxUSE_STATBOX
#include "gdk/gdk.h"
#include "gtk/gtk.h"
@@ -72,3 +74,5 @@ void wxStaticBox::ApplyWidgetStyle()
SetWidgetStyle();
gtk_widget_set_style( m_widget, m_widgetStyle );
}
#endif

View File

@@ -13,6 +13,8 @@
#include "wx/statline.h"
#if wxUSE_STATLINE
#include "gdk/gdk.h"
#include "gtk/gtk.h"
@@ -55,3 +57,4 @@ bool wxStaticLine::Create( wxWindow *parent, wxWindowID id,
return TRUE;
}
#endif

View File

@@ -12,6 +12,9 @@
#endif
#include "wx/toolbar.h"
#if wxUSE_TOOLBAR
#include "wx/frame.h"
#include "glib.h"
@@ -584,3 +587,4 @@ void wxToolBar::OnIdle( wxIdleEvent &WXUNUSED(ievent) )
}
}
#endif

View File

@@ -301,12 +301,12 @@ wxString wxTextCtrl::GetValue() const
{
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;
}

View File

@@ -103,5 +103,6 @@ void wxToolTip::SetDelay( long msecs )
gtk_tooltips_set_delay( ss_tooltips, msecs );
}
#endif

View File

@@ -74,7 +74,7 @@ static wxChar *GetResourcePath(wxChar *buf, wxChar *name, bool create)
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;
@@ -139,7 +139,7 @@ static void wxXMergeDatabases()
else
{
(void)GetIniFile(filename, (wxChar *) NULL);
serverDB = XrmGetFileDatabase(wxConv_file.cWX2MB(filename));
serverDB = XrmGetFileDatabase(wxConvCurrent->cWX2MB(filename));
}
if (serverDB)
XrmMergeDatabases(serverDB, &wxResourceDatabase);
@@ -169,10 +169,10 @@ static void wxXMergeDatabases()
#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);
}
@@ -192,7 +192,7 @@ void wxFlushResources()
(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;
@@ -231,7 +231,7 @@ bool wxWriteResource(const wxString& section, const wxString& entry, const wxStr
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);
}
@@ -285,7 +285,7 @@ bool wxGetResource(const wxString& section, const wxString& entry, char **value,
}
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);
}

View File

@@ -2545,7 +2545,7 @@ void wxWindow::DoSetToolTip( wxToolTip *tip )
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

View File

@@ -2,7 +2,7 @@
// Name: accel.cpp
// Purpose:
// Author: Robert Roebling
// Id: $id$
// Id: $id:$
// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@@ -13,14 +13,9 @@
#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
@@ -94,3 +89,4 @@ int wxAcceleratorTable::GetCommand( wxKeyEvent &event )
return -1;
}
#endif

View File

@@ -662,7 +662,7 @@ int wxEntry( int argc, char *argv[] )
{
gtk_set_locale();
if (!wxOKlibc()) wxConv_current = &wxConv_local;
if (!wxOKlibc()) wxConvCurrent = &wxConvLocal;
gtk_init( &argc, &argv );

View File

@@ -59,7 +59,7 @@ bool wxMask::Create( const wxBitmap& bitmap, const wxColour& colour )
m_bitmap = (GdkBitmap*) NULL;
}
wxFAIL_MSG( "TODO" );
wxFAIL_MSG( _T("TODO") );
return FALSE;
}
@@ -72,7 +72,7 @@ bool wxMask::Create( const wxBitmap& WXUNUSED(bitmap), int WXUNUSED(paletteIndex
m_bitmap = (GdkBitmap*) NULL;
}
wxFAIL_MSG( "not implemented" );
wxFAIL_MSG( _T("not implemented") );
return FALSE;
}
@@ -87,7 +87,7 @@ bool wxMask::Create( const wxBitmap& bitmap )
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 );

View File

@@ -13,6 +13,8 @@
#include "wx/bmpbuttn.h"
#if wxUSE_BMPBUTTON
#include "gdk/gdk.h"
#include "gtk/gtk.h"
@@ -309,3 +311,5 @@ void wxBitmapButton::EndSelect()
m_isSelected = FALSE;
SetBitmap();
}
#endif

View File

@@ -14,6 +14,8 @@
#include "wx/checkbox.h"
#if wxUSE_CHECKBOX
#include "gdk/gdk.h"
#include "gtk/gtk.h"
@@ -184,3 +186,4 @@ void wxCheckBox::ApplyWidgetStyle()
gtk_widget_set_style( m_widgetLabel, m_widgetStyle );
}
#endif

View File

@@ -13,6 +13,8 @@
#include "wx/checklst.h"
#if wxUSE_CHECKLISTBOX
#include "gdk/gdk.h"
#include "gtk/gtk.h"
@@ -69,7 +71,7 @@ void wxCheckListBox::Check( int index, bool check )
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;
@@ -91,3 +93,5 @@ int wxCheckListBox::GetItemHeight() const
// FIXME
return 22;
}
#endif

View File

@@ -251,7 +251,7 @@ int wxChoice::FindString( const wxString &string ) const
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;
@@ -304,7 +304,7 @@ wxString wxChoice::GetString( int n ) const
wxASSERT_MSG( label != NULL , _T("wxChoice: invalid label") );
return wxString(label->label,*wxConv_current);
return wxString(label->label,*wxConvCurrent);
}
child = child->next;
count++;
@@ -323,7 +323,7 @@ wxString wxChoice::GetStringSelection() const
wxASSERT_MSG( label != NULL , _T("wxChoice: invalid label") );
return wxString(label->label,*wxConv_current);
return wxString(label->label,*wxConvCurrent);
}
int wxChoice::Number() const

View File

@@ -12,6 +12,9 @@
#endif
#include "wx/combobox.h"
#if wxUSE_COMBOBOX
#include "wx/settings.h"
#include <wx/intl.h>
@@ -625,3 +628,4 @@ bool wxComboBox::IsOwnGtkWindow( GdkWindow *window )
(window == GTK_COMBO(m_widget)->button->window ) );
}
#endif

View File

@@ -145,13 +145,13 @@ wxFileDialog::wxFileDialog( wxWindow *parent, const wxString& message,
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 );

View File

@@ -401,7 +401,7 @@ static GdkFont*wxLoadQueryFont( int pointSize, int family, int style, int weight
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 );
@@ -427,7 +427,7 @@ static GdkFont*wxLoadQueryFont( int pointSize, int family, int style, int weight
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,

View File

@@ -16,8 +16,12 @@
#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"
@@ -560,9 +564,12 @@ void wxFrame::DoGetClientSize( int *width, int *height ) const
(*height) -= wxPLACE_HOLDER;
}
#if wxUSE_STATUSBAR
/* status bar */
if (m_frameStatusBar) (*height) -= wxSTATUS_HEIGHT;
#endif
#if wxUSE_TOOLBAR
/* tool bar */
if (m_frameToolBar)
{
@@ -575,6 +582,7 @@ void wxFrame::DoGetClientSize( int *width, int *height ) const
else
(*height) -= wxPLACE_HOLDER;
}
#endif
/* mini edge */
(*height) -= m_miniEdge*2 + m_miniTitle;
@@ -598,9 +606,12 @@ void wxFrame::DoSetClientSize( int width, int height )
height += wxPLACE_HOLDER;
}
#if wxUSE_STATUSBAR
/* status bar */
if (m_frameStatusBar) height += wxSTATUS_HEIGHT;
#endif
#if wxUSE_TOOLBAR
/* tool bar */
if (m_frameToolBar)
{
@@ -613,6 +624,7 @@ void wxFrame::DoSetClientSize( int width, int height )
else
height += wxPLACE_HOLDER;
}
#endif
wxWindow::DoSetClientSize( width + m_miniEdge*2, height + m_miniEdge*2 + m_miniTitle );
}
@@ -674,6 +686,7 @@ void wxFrame::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y), int width, int height
client_area_y_offset += hh;
}
#if wxUSE_TOOLBAR
if (m_frameToolBar)
{
int xx = m_miniEdge;
@@ -697,6 +710,7 @@ void wxFrame::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y), int width, int height
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;
@@ -712,6 +726,7 @@ void wxFrame::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y), int width, int height
is no need to set the size or position of m_wxwindow. */
}
#if wxUSE_STATUSBAR
if (m_frameStatusBar)
{
int xx = 0 + m_miniEdge;
@@ -726,6 +741,7 @@ void wxFrame::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y), int width, int height
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 );
@@ -764,8 +780,12 @@ void wxFrame::OnInternalIdle()
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) )

Some files were not shown because too many files have changed in this diff Show More