wxFrame::SetIcon()
it's possible now to call Close() after ShowModal() dialog sample works changed wxString::First() etc to return -1 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@382 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -7,6 +7,8 @@
|
|||||||
#include "wx/generic/fontdlgg.h"
|
#include "wx/generic/fontdlgg.h"
|
||||||
#elif defined(__WXGTK__)
|
#elif defined(__WXGTK__)
|
||||||
#include "wx/generic/fontdlgg.h"
|
#include "wx/generic/fontdlgg.h"
|
||||||
|
# define wxFontDialog wxGenericFontDialog
|
||||||
|
# define classwxFontDialog classwxGenericFontDialog
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -31,6 +31,7 @@ class wxMemoryDC;
|
|||||||
class wxToolBar;
|
class wxToolBar;
|
||||||
class wxBitmapButton;
|
class wxBitmapButton;
|
||||||
class wxStaticBitmap;
|
class wxStaticBitmap;
|
||||||
|
class wxFrame;
|
||||||
|
|
||||||
class wxMask;
|
class wxMask;
|
||||||
class wxBitmap;
|
class wxBitmap;
|
||||||
@@ -59,6 +60,7 @@ class wxMask: public wxObject
|
|||||||
friend wxToolBar;
|
friend wxToolBar;
|
||||||
friend wxBitmapButton;
|
friend wxBitmapButton;
|
||||||
friend wxStaticBitmap;
|
friend wxStaticBitmap;
|
||||||
|
friend wxFrame;
|
||||||
|
|
||||||
GdkBitmap *GetBitmap() const;
|
GdkBitmap *GetBitmap() const;
|
||||||
|
|
||||||
@@ -119,6 +121,7 @@ class wxBitmap: public wxObject
|
|||||||
friend wxToolBar;
|
friend wxToolBar;
|
||||||
friend wxBitmapButton;
|
friend wxBitmapButton;
|
||||||
friend wxStaticBitmap;
|
friend wxStaticBitmap;
|
||||||
|
friend wxFrame;
|
||||||
|
|
||||||
GdkPixmap *GetPixmap() const;
|
GdkPixmap *GetPixmap() const;
|
||||||
GdkBitmap *GetBitmap() const;
|
GdkBitmap *GetBitmap() const;
|
||||||
|
@@ -80,6 +80,8 @@ public:
|
|||||||
void SetTitle( const wxString &title );
|
void SetTitle( const wxString &title );
|
||||||
wxString GetTitle() const { return m_title; }
|
wxString GetTitle() const { return m_title; }
|
||||||
|
|
||||||
|
void SetIcon( const wxIcon &icon );
|
||||||
|
|
||||||
void OnActivate( wxActivateEvent &WXUNUSED(event) ) { } // called from docview.cpp
|
void OnActivate( wxActivateEvent &WXUNUSED(event) ) { } // called from docview.cpp
|
||||||
void OnSize( wxSizeEvent &event );
|
void OnSize( wxSizeEvent &event );
|
||||||
void OnCloseWindow( wxCloseEvent& event );
|
void OnCloseWindow( wxCloseEvent& event );
|
||||||
@@ -104,6 +106,7 @@ private:
|
|||||||
bool m_doingOnSize;
|
bool m_doingOnSize;
|
||||||
bool m_addPrivateChild; // for toolbar (and maybe menubar)
|
bool m_addPrivateChild; // for toolbar (and maybe menubar)
|
||||||
wxString m_title;
|
wxString m_title;
|
||||||
|
wxIcon m_icon;
|
||||||
|
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
|
@@ -31,6 +31,7 @@ class wxMemoryDC;
|
|||||||
class wxToolBar;
|
class wxToolBar;
|
||||||
class wxBitmapButton;
|
class wxBitmapButton;
|
||||||
class wxStaticBitmap;
|
class wxStaticBitmap;
|
||||||
|
class wxFrame;
|
||||||
|
|
||||||
class wxMask;
|
class wxMask;
|
||||||
class wxBitmap;
|
class wxBitmap;
|
||||||
@@ -59,6 +60,7 @@ class wxMask: public wxObject
|
|||||||
friend wxToolBar;
|
friend wxToolBar;
|
||||||
friend wxBitmapButton;
|
friend wxBitmapButton;
|
||||||
friend wxStaticBitmap;
|
friend wxStaticBitmap;
|
||||||
|
friend wxFrame;
|
||||||
|
|
||||||
GdkBitmap *GetBitmap() const;
|
GdkBitmap *GetBitmap() const;
|
||||||
|
|
||||||
@@ -119,6 +121,7 @@ class wxBitmap: public wxObject
|
|||||||
friend wxToolBar;
|
friend wxToolBar;
|
||||||
friend wxBitmapButton;
|
friend wxBitmapButton;
|
||||||
friend wxStaticBitmap;
|
friend wxStaticBitmap;
|
||||||
|
friend wxFrame;
|
||||||
|
|
||||||
GdkPixmap *GetPixmap() const;
|
GdkPixmap *GetPixmap() const;
|
||||||
GdkBitmap *GetBitmap() const;
|
GdkBitmap *GetBitmap() const;
|
||||||
|
@@ -80,6 +80,8 @@ public:
|
|||||||
void SetTitle( const wxString &title );
|
void SetTitle( const wxString &title );
|
||||||
wxString GetTitle() const { return m_title; }
|
wxString GetTitle() const { return m_title; }
|
||||||
|
|
||||||
|
void SetIcon( const wxIcon &icon );
|
||||||
|
|
||||||
void OnActivate( wxActivateEvent &WXUNUSED(event) ) { } // called from docview.cpp
|
void OnActivate( wxActivateEvent &WXUNUSED(event) ) { } // called from docview.cpp
|
||||||
void OnSize( wxSizeEvent &event );
|
void OnSize( wxSizeEvent &event );
|
||||||
void OnCloseWindow( wxCloseEvent& event );
|
void OnCloseWindow( wxCloseEvent& event );
|
||||||
@@ -104,6 +106,7 @@ private:
|
|||||||
bool m_doingOnSize;
|
bool m_doingOnSize;
|
||||||
bool m_addPrivateChild; // for toolbar (and maybe menubar)
|
bool m_addPrivateChild; // for toolbar (and maybe menubar)
|
||||||
wxString m_title;
|
wxString m_title;
|
||||||
|
wxIcon m_icon;
|
||||||
|
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
|
@@ -537,13 +537,13 @@ public:
|
|||||||
wxString& Remove(size_t nStart, size_t nLen)
|
wxString& Remove(size_t nStart, size_t nLen)
|
||||||
{ return erase( nStart, nLen ); }
|
{ return erase( nStart, nLen ); }
|
||||||
|
|
||||||
size_t First( const char ch ) const { return find(ch); }
|
int First( const char ch ) const { size_t res = find(ch); return res == wxString::npos ? -1 : res; }
|
||||||
size_t First( const char* psz ) const { return find(psz); }
|
int First( const char* psz ) const { size_t res = find(psz); return res == wxString::npos ? -1 : res; }
|
||||||
size_t First( const wxString &str ) const { return find(str); }
|
int First( const wxString &str ) const { size_t res = find(str); return res == wxString::npos ? -1 : res; }
|
||||||
|
|
||||||
size_t Last( const char ch ) const { return rfind(ch,0); }
|
int Last( const char ch ) const { size_t res = rfind(ch,0); return res == wxString::npos ? -1 : res; }
|
||||||
size_t Last( const char* psz ) const { return rfind(psz,0); }
|
int Last( const char* psz ) const { size_t res = rfind(psz,0); return res == wxString::npos ? -1 : res; }
|
||||||
size_t Last( const wxString &str ) const { return rfind(str,0); }
|
int Last( const wxString &str ) const { size_t res = rfind(str,0); return res == wxString::npos ? -1 : res; }
|
||||||
|
|
||||||
/// same as IsEmpty
|
/// same as IsEmpty
|
||||||
bool IsNull() const { return IsEmpty(); }
|
bool IsNull() const { return IsEmpty(); }
|
||||||
|
@@ -110,16 +110,18 @@ implemented.
|
|||||||
* Compiling
|
* Compiling
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
This must be done in ~/wxGTK
|
The following must be done in ~/wxGTK
|
||||||
|
|
||||||
First you have to create all makefiles in all subdirectories:
|
First you have to create all makefiles in all subdirectories:
|
||||||
|
|
||||||
make makefiles
|
make Makefiles
|
||||||
|
|
||||||
Dependencies are generated automatically using
|
Dependencies are generated automatically using
|
||||||
|
|
||||||
make depend
|
make depend
|
||||||
|
|
||||||
|
for some reason, this doesn't seem to work.
|
||||||
|
|
||||||
Now the makefiles are created you can compile everything is as simple
|
Now the makefiles are created you can compile everything is as simple
|
||||||
as typing:
|
as typing:
|
||||||
|
|
||||||
@@ -160,7 +162,7 @@ will do the work for you.
|
|||||||
--------------------------
|
--------------------------
|
||||||
|
|
||||||
I propose to put all contributed programs in the directory
|
I propose to put all contributed programs in the directory
|
||||||
"~/wcGTK/user", with a directory of its own.
|
"~/wxGTK/user", with a directory of its own.
|
||||||
|
|
||||||
This directory then should include the following files:
|
This directory then should include the following files:
|
||||||
|
|
||||||
@@ -186,7 +188,7 @@ this will include all the necessary definitions for creating the applications
|
|||||||
|
|
||||||
the only case where you might want to add another line is the following:
|
the only case where you might want to add another line is the following:
|
||||||
this version of configure also supports creation of source archives of the
|
this version of configure also supports creation of source archives of the
|
||||||
application for easy distribution and updates to newer version of wxxt.
|
application for easy distribution and updates to newer version of wxGTK.
|
||||||
For this purpose all files in the application-directory will be put into
|
For this purpose all files in the application-directory will be put into
|
||||||
a gziped tar-file in the full notation user/<your application>/*
|
a gziped tar-file in the full notation user/<your application>/*
|
||||||
if you want to include some other files that you want "more visible", like
|
if you want to include some other files that you want "more visible", like
|
||||||
@@ -206,7 +208,7 @@ distribution is:
|
|||||||
|
|
||||||
make distrib
|
make distrib
|
||||||
|
|
||||||
NOTE: If you are in the base directory of wxxt it will create
|
NOTE: If you are in the base directory of wxGTK it will create
|
||||||
distribution packages for wxxt as well as for all packages in the
|
distribution packages for wxxt as well as for all packages in the
|
||||||
user directory.
|
user directory.
|
||||||
So if you want to create only packages for the files in user,
|
So if you want to create only packages for the files in user,
|
||||||
|
1
samples/dialogs/Makefile
Normal file
1
samples/dialogs/Makefile
Normal file
@@ -0,0 +1 @@
|
|||||||
|
include ../../src/gtk/setup/general/makeapp
|
26
samples/dialogs/Makefile.in
Normal file
26
samples/dialogs/Makefile.in
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
# WXXT base directory
|
||||||
|
WXBASEDIR=@WXBASEDIR@
|
||||||
|
|
||||||
|
# set the OS type for compilation
|
||||||
|
OS=@OS@
|
||||||
|
# compile a library only
|
||||||
|
RULE=bin
|
||||||
|
|
||||||
|
# define library name
|
||||||
|
BIN_TARGET=test
|
||||||
|
# define library sources
|
||||||
|
BIN_SRC=\
|
||||||
|
dialogs.cpp
|
||||||
|
|
||||||
|
#define library objects
|
||||||
|
BIN_OBJ=\
|
||||||
|
dialogs.o
|
||||||
|
|
||||||
|
# additional things needed to link
|
||||||
|
BIN_LINK=
|
||||||
|
|
||||||
|
# additional things needed to compile
|
||||||
|
ADD_COMPILE=
|
||||||
|
|
||||||
|
# include the definitions now
|
||||||
|
include ../../../template.mak
|
@@ -103,7 +103,7 @@ MyFrame::MyFrame(wxWindow *parent, const wxString& title, const wxPoint& pos, co
|
|||||||
wxFrame(parent, -1, title, pos, size)
|
wxFrame(parent, -1, title, pos, size)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
void MyFrame::ChooseColour(wxCommandEvent& event)
|
void MyFrame::ChooseColour(wxCommandEvent& WXUNUSED(event) )
|
||||||
{
|
{
|
||||||
wxColourData data;
|
wxColourData data;
|
||||||
data.SetChooseFull(TRUE);
|
data.SetChooseFull(TRUE);
|
||||||
@@ -126,7 +126,7 @@ void MyFrame::ChooseColour(wxCommandEvent& event)
|
|||||||
dialog->Close();
|
dialog->Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyFrame::ChooseFont(wxCommandEvent& event)
|
void MyFrame::ChooseFont(wxCommandEvent& WXUNUSED(event) )
|
||||||
{
|
{
|
||||||
wxFontData data;
|
wxFontData data;
|
||||||
data.SetInitialFont(wxGetApp().m_canvasFont);
|
data.SetInitialFont(wxGetApp().m_canvasFont);
|
||||||
@@ -144,7 +144,7 @@ void MyFrame::ChooseFont(wxCommandEvent& event)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(__WXMSW__) || USE_GENERIC_DIALOGS_IN_MSW
|
#if !defined(__WXMSW__) || USE_GENERIC_DIALOGS_IN_MSW
|
||||||
void MyFrame::ChooseColourGeneric(wxCommandEvent& event)
|
void MyFrame::ChooseColourGeneric(wxCommandEvent& WXUNUSED(event))
|
||||||
{
|
{
|
||||||
wxColourData data;
|
wxColourData data;
|
||||||
data.SetChooseFull(TRUE);
|
data.SetChooseFull(TRUE);
|
||||||
@@ -167,7 +167,7 @@ void MyFrame::ChooseColourGeneric(wxCommandEvent& event)
|
|||||||
dialog->Close();
|
dialog->Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyFrame::ChooseFontGeneric(wxCommandEvent& event)
|
void MyFrame::ChooseFontGeneric(wxCommandEvent& WXUNUSED(event) )
|
||||||
{
|
{
|
||||||
wxFontData data;
|
wxFontData data;
|
||||||
data.SetInitialFont(wxGetApp().m_canvasFont);
|
data.SetInitialFont(wxGetApp().m_canvasFont);
|
||||||
@@ -185,7 +185,7 @@ void MyFrame::ChooseFontGeneric(wxCommandEvent& event)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void MyFrame::MessageBox(wxCommandEvent& event)
|
void MyFrame::MessageBox(wxCommandEvent& WXUNUSED(event) )
|
||||||
{
|
{
|
||||||
wxMessageDialog dialog(this, "This is a message box\nA long, long string to test out the message box properly",
|
wxMessageDialog dialog(this, "This is a message box\nA long, long string to test out the message box properly",
|
||||||
"Message box text", wxYES_NO|wxCANCEL);
|
"Message box text", wxYES_NO|wxCANCEL);
|
||||||
@@ -193,7 +193,7 @@ void MyFrame::MessageBox(wxCommandEvent& event)
|
|||||||
dialog.ShowModal();
|
dialog.ShowModal();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyFrame::TextEntry(wxCommandEvent& event)
|
void MyFrame::TextEntry(wxCommandEvent& WXUNUSED(event) )
|
||||||
{
|
{
|
||||||
wxTextEntryDialog dialog(this, "This is a small sample\nA long, long string to test out the text entrybox",
|
wxTextEntryDialog dialog(this, "This is a small sample\nA long, long string to test out the text entrybox",
|
||||||
"Please enter a string", "Default value", wxOK|wxCANCEL);
|
"Please enter a string", "Default value", wxOK|wxCANCEL);
|
||||||
@@ -205,7 +205,7 @@ void MyFrame::TextEntry(wxCommandEvent& event)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyFrame::SingleChoice(wxCommandEvent& event)
|
void MyFrame::SingleChoice(wxCommandEvent& WXUNUSED(event) )
|
||||||
{
|
{
|
||||||
const wxString choices[] = { "One", "Two", "Three", "Four", "Five" } ;
|
const wxString choices[] = { "One", "Two", "Three", "Four", "Five" } ;
|
||||||
int n = 5;
|
int n = 5;
|
||||||
@@ -222,7 +222,7 @@ void MyFrame::SingleChoice(wxCommandEvent& event)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyFrame::FileOpen(wxCommandEvent& event)
|
void MyFrame::FileOpen(wxCommandEvent& WXUNUSED(event) )
|
||||||
{
|
{
|
||||||
wxFileDialog dialog(this, "Testing open file dialog", "", "", "*.txt", 0);
|
wxFileDialog dialog(this, "Testing open file dialog", "", "", "*.txt", 0);
|
||||||
|
|
||||||
@@ -233,7 +233,7 @@ void MyFrame::FileOpen(wxCommandEvent& event)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyFrame::FileSave(wxCommandEvent& event)
|
void MyFrame::FileSave(wxCommandEvent& WXUNUSED(event) )
|
||||||
{
|
{
|
||||||
wxFileDialog dialog(this, "Testing save file dialog", "", "",
|
wxFileDialog dialog(this, "Testing save file dialog", "", "",
|
||||||
"Text files (*.txt)|*.txt|Document files (*.doc)|*.doc",
|
"Text files (*.txt)|*.txt|Document files (*.doc)|*.doc",
|
||||||
@@ -248,8 +248,9 @@ void MyFrame::FileSave(wxCommandEvent& event)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyFrame::DirChoose(wxCommandEvent& event)
|
void MyFrame::DirChoose(wxCommandEvent& WXUNUSED(event) )
|
||||||
{
|
{
|
||||||
|
#ifndef __WXGTK__
|
||||||
wxDirDialog dialog(this, "Testing directory picker", "");
|
wxDirDialog dialog(this, "Testing directory picker", "");
|
||||||
|
|
||||||
if (dialog.ShowModal() == wxID_OK)
|
if (dialog.ShowModal() == wxID_OK)
|
||||||
@@ -257,14 +258,15 @@ void MyFrame::DirChoose(wxCommandEvent& event)
|
|||||||
wxMessageDialog dialog2(this, dialog.GetPath(), "Selected path");
|
wxMessageDialog dialog2(this, dialog.GetPath(), "Selected path");
|
||||||
dialog2.ShowModal();
|
dialog2.ShowModal();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyFrame::OnExit(wxCommandEvent& event)
|
void MyFrame::OnExit(wxCommandEvent& WXUNUSED(event) )
|
||||||
{
|
{
|
||||||
Close(TRUE);
|
Close(TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyCanvas::OnPaint(wxPaintEvent& event)
|
void MyCanvas::OnPaint(wxPaintEvent& WXUNUSED(event) )
|
||||||
{
|
{
|
||||||
wxPaintDC dc(this);
|
wxPaintDC dc(this);
|
||||||
dc.SetFont(wxGetApp().m_canvasFont);
|
dc.SetFont(wxGetApp().m_canvasFont);
|
||||||
|
@@ -25,6 +25,10 @@
|
|||||||
#include "wx/wx.h"
|
#include "wx/wx.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __WXGTK__
|
||||||
|
#include "mondrian.xpm"
|
||||||
|
#endif
|
||||||
|
|
||||||
// Define a new application type
|
// Define a new application type
|
||||||
class MyApp: public wxApp
|
class MyApp: public wxApp
|
||||||
{ public:
|
{ public:
|
||||||
@@ -68,8 +72,8 @@ bool MyApp::OnInit(void)
|
|||||||
#ifdef __WXMSW__
|
#ifdef __WXMSW__
|
||||||
frame->SetIcon(wxIcon("mondrian"));
|
frame->SetIcon(wxIcon("mondrian"));
|
||||||
#endif
|
#endif
|
||||||
#ifdef __X__
|
#ifdef __WXGTK__
|
||||||
frame->SetIcon(wxIcon("aiai.xbm"));
|
frame->SetIcon(wxIcon( mondrian_xpm ));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Make a menubar
|
// Make a menubar
|
||||||
|
44
samples/minimal/mondrian.xpm
Normal file
44
samples/minimal/mondrian.xpm
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
/* XPM */
|
||||||
|
static char *mondrian_xpm[] = {
|
||||||
|
/* columns rows colors chars-per-pixel */
|
||||||
|
"32 32 6 1",
|
||||||
|
" c Black",
|
||||||
|
". c Blue",
|
||||||
|
"X c #00bf00",
|
||||||
|
"o c Red",
|
||||||
|
"O c Yellow",
|
||||||
|
"+ c Gray100",
|
||||||
|
/* pixels */
|
||||||
|
" ",
|
||||||
|
" oooooo +++++++++++++++++++++++ ",
|
||||||
|
" oooooo +++++++++++++++++++++++ ",
|
||||||
|
" oooooo +++++++++++++++++++++++ ",
|
||||||
|
" oooooo +++++++++++++++++++++++ ",
|
||||||
|
" oooooo +++++++++++++++++++++++ ",
|
||||||
|
" oooooo +++++++++++++++++++++++ ",
|
||||||
|
" oooooo +++++++++++++++++++++++ ",
|
||||||
|
" ",
|
||||||
|
" ++++++ ++++++++++++++++++ .... ",
|
||||||
|
" ++++++ ++++++++++++++++++ .... ",
|
||||||
|
" ++++++ ++++++++++++++++++ .... ",
|
||||||
|
" ++++++ ++++++++++++++++++ .... ",
|
||||||
|
" ++++++ ++++++++++++++++++ .... ",
|
||||||
|
" ++++++ ++++++++++++++++++ ",
|
||||||
|
" ++++++ ++++++++++++++++++ ++++ ",
|
||||||
|
" ++++++ ++++++++++++++++++ ++++ ",
|
||||||
|
" ++++++ ++++++++++++++++++ ++++ ",
|
||||||
|
" ++++++ ++++++++++++++++++ ++++ ",
|
||||||
|
" ++++++ ++++++++++++++++++ ++++ ",
|
||||||
|
" ++++++ ++++++++++++++++++ ++++ ",
|
||||||
|
" ++++++ ++++++++++++++++++ ++++ ",
|
||||||
|
" ++++++ ++++++++++++++++++ ++++ ",
|
||||||
|
" ++++++ ++++++++++++++++++ ++++ ",
|
||||||
|
" ++++++ ++++ ",
|
||||||
|
" ++++++ OOOOOOOOOOOO XXXXX ++++ ",
|
||||||
|
" ++++++ OOOOOOOOOOOO XXXXX ++++ ",
|
||||||
|
" ++++++ OOOOOOOOOOOO XXXXX ++++ ",
|
||||||
|
" ++++++ OOOOOOOOOOOO XXXXX ++++ ",
|
||||||
|
" ++++++ OOOOOOOOOOOO XXXXX ++++ ",
|
||||||
|
" ++++++ OOOOOOOOOOOO XXXXX ++++ ",
|
||||||
|
" "
|
||||||
|
};
|
@@ -1270,7 +1270,7 @@ void wxArrayString::Remove(const char *sz)
|
|||||||
|
|
||||||
// sort array elements using passed comparaison function
|
// sort array elements using passed comparaison function
|
||||||
|
|
||||||
void wxArrayString::Sort(bool bCase, bool bReverse)
|
void wxArrayString::Sort(bool WXUNUSED(bCase), bool WXUNUSED(bReverse) )
|
||||||
{
|
{
|
||||||
//@@@@ TO DO
|
//@@@@ TO DO
|
||||||
//qsort(m_pItems, m_nCount, sizeof(char *), fCmp);
|
//qsort(m_pItems, m_nCount, sizeof(char *), fCmp);
|
||||||
|
@@ -54,7 +54,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxDialog,wxWindow)
|
|||||||
wxDialog::wxDialog(void)
|
wxDialog::wxDialog(void)
|
||||||
{
|
{
|
||||||
m_title = "";
|
m_title = "";
|
||||||
m_modalShowing = TRUE;
|
m_modalShowing = FALSE;
|
||||||
wxTopLevelWindows.Insert( this );
|
wxTopLevelWindows.Insert( this );
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -63,6 +63,7 @@ wxDialog::wxDialog( wxWindow *parent,
|
|||||||
const wxPoint &pos, const wxSize &size,
|
const wxPoint &pos, const wxSize &size,
|
||||||
long style, const wxString &name )
|
long style, const wxString &name )
|
||||||
{
|
{
|
||||||
|
m_modalShowing = FALSE;
|
||||||
wxTopLevelWindows.Insert( this );
|
wxTopLevelWindows.Insert( this );
|
||||||
Create( parent, id, title, pos, size, style, name );
|
Create( parent, id, title, pos, size, style, name );
|
||||||
};
|
};
|
||||||
@@ -76,8 +77,6 @@ bool wxDialog::Create( wxWindow *parent,
|
|||||||
|
|
||||||
PreCreation( parent, id, pos, size, style, name );
|
PreCreation( parent, id, pos, size, style, name );
|
||||||
|
|
||||||
m_modalShowing = ((m_windowStyle & wxDIALOG_MODAL) == wxDIALOG_MODAL);
|
|
||||||
|
|
||||||
m_widget = gtk_window_new( GTK_WINDOW_TOPLEVEL );
|
m_widget = gtk_window_new( GTK_WINDOW_TOPLEVEL );
|
||||||
GTK_WIDGET_UNSET_FLAGS( m_widget, GTK_CAN_FOCUS );
|
GTK_WIDGET_UNSET_FLAGS( m_widget, GTK_CAN_FOCUS );
|
||||||
|
|
||||||
@@ -189,7 +188,7 @@ void wxDialog::OnCloseWindow(wxCloseEvent& event)
|
|||||||
|
|
||||||
bool wxDialog::Show( bool show )
|
bool wxDialog::Show( bool show )
|
||||||
{
|
{
|
||||||
if (!show && m_modalShowing)
|
if (!show && IsModal() && m_modalShowing)
|
||||||
{
|
{
|
||||||
EndModal( wxID_CANCEL );
|
EndModal( wxID_CANCEL );
|
||||||
};
|
};
|
||||||
@@ -198,25 +197,31 @@ bool wxDialog::Show( bool show )
|
|||||||
|
|
||||||
if (show) InitDialog();
|
if (show) InitDialog();
|
||||||
|
|
||||||
if (show && m_modalShowing)
|
|
||||||
{
|
|
||||||
gtk_grab_add( m_widget );
|
|
||||||
gtk_main();
|
|
||||||
gtk_grab_remove( m_widget );
|
|
||||||
};
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
};
|
};
|
||||||
|
|
||||||
int wxDialog::ShowModal(void)
|
int wxDialog::ShowModal(void)
|
||||||
{
|
{
|
||||||
|
if (m_modalShowing) return GetReturnCode();
|
||||||
|
|
||||||
Show( TRUE );
|
Show( TRUE );
|
||||||
|
|
||||||
|
m_modalShowing = TRUE;
|
||||||
|
|
||||||
|
gtk_grab_add( m_widget );
|
||||||
|
gtk_main();
|
||||||
|
gtk_grab_remove( m_widget );
|
||||||
|
|
||||||
return GetReturnCode();
|
return GetReturnCode();
|
||||||
};
|
};
|
||||||
|
|
||||||
void wxDialog::EndModal( int retCode )
|
void wxDialog::EndModal( int retCode )
|
||||||
{
|
{
|
||||||
SetReturnCode( retCode );
|
SetReturnCode( retCode );
|
||||||
|
|
||||||
|
if (!m_modalShowing) return;
|
||||||
|
m_modalShowing = FALSE;
|
||||||
|
|
||||||
gtk_main_quit();
|
gtk_main_quit();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -442,3 +442,16 @@ void wxFrame::SetSizeHints(int minW, int minH, int maxW, int maxH, int WXUNUSED(
|
|||||||
gdk_window_set_hints( m_wxwindow->window, -1, -1,
|
gdk_window_set_hints( m_wxwindow->window, -1, -1,
|
||||||
minW, minH, maxW, maxH, GDK_HINT_MIN_SIZE | GDK_HINT_MIN_SIZE );
|
minW, minH, maxW, maxH, GDK_HINT_MIN_SIZE | GDK_HINT_MIN_SIZE );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wxFrame::SetIcon( const wxIcon &icon )
|
||||||
|
{
|
||||||
|
m_icon = icon;
|
||||||
|
if (!icon.Ok()) return;
|
||||||
|
|
||||||
|
wxMask *mask = icon.GetMask();
|
||||||
|
GdkBitmap *bm = NULL;
|
||||||
|
if (mask) bm = mask->GetBitmap();
|
||||||
|
|
||||||
|
gdk_window_set_icon( m_widget->window, NULL, icon.GetPixmap(), bm );
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -48,11 +48,11 @@ void wxMenuBar::Append( wxMenu *menu, const wxString &title )
|
|||||||
m_menus.Append( menu );
|
m_menus.Append( menu );
|
||||||
menu->m_title = title; // ??????
|
menu->m_title = title; // ??????
|
||||||
|
|
||||||
size_t pos;
|
int pos;
|
||||||
do {
|
do {
|
||||||
pos = menu->m_title.First( '&' );
|
pos = menu->m_title.First( '&' );
|
||||||
if (pos != wxString::npos) menu->m_title.Remove( pos, 1 );
|
if (pos != -1) menu->m_title.Remove( pos, 1 );
|
||||||
} while (pos != wxString::npos);
|
} while (pos != -1);
|
||||||
|
|
||||||
GtkWidget *root_menu;
|
GtkWidget *root_menu;
|
||||||
root_menu = gtk_menu_item_new_with_label( WXSTRINGCAST(menu->m_title) );
|
root_menu = gtk_menu_item_new_with_label( WXSTRINGCAST(menu->m_title) );
|
||||||
@@ -262,11 +262,11 @@ int wxMenu::FindItem( const wxString itemString ) const
|
|||||||
{
|
{
|
||||||
wxString s( itemString );
|
wxString s( itemString );
|
||||||
|
|
||||||
size_t pos;
|
int pos;
|
||||||
do {
|
do {
|
||||||
pos = s.First( '&' );
|
pos = s.First( '&' );
|
||||||
if (pos != wxString::npos) s.Remove( pos, 1 );
|
if (pos != -1) s.Remove( pos, 1 );
|
||||||
} while (pos != wxString::npos);
|
} while (pos != -1);
|
||||||
|
|
||||||
wxNode *node = m_items.First();
|
wxNode *node = m_items.First();
|
||||||
while (node)
|
while (node)
|
||||||
|
@@ -54,7 +54,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxDialog,wxWindow)
|
|||||||
wxDialog::wxDialog(void)
|
wxDialog::wxDialog(void)
|
||||||
{
|
{
|
||||||
m_title = "";
|
m_title = "";
|
||||||
m_modalShowing = TRUE;
|
m_modalShowing = FALSE;
|
||||||
wxTopLevelWindows.Insert( this );
|
wxTopLevelWindows.Insert( this );
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -63,6 +63,7 @@ wxDialog::wxDialog( wxWindow *parent,
|
|||||||
const wxPoint &pos, const wxSize &size,
|
const wxPoint &pos, const wxSize &size,
|
||||||
long style, const wxString &name )
|
long style, const wxString &name )
|
||||||
{
|
{
|
||||||
|
m_modalShowing = FALSE;
|
||||||
wxTopLevelWindows.Insert( this );
|
wxTopLevelWindows.Insert( this );
|
||||||
Create( parent, id, title, pos, size, style, name );
|
Create( parent, id, title, pos, size, style, name );
|
||||||
};
|
};
|
||||||
@@ -76,8 +77,6 @@ bool wxDialog::Create( wxWindow *parent,
|
|||||||
|
|
||||||
PreCreation( parent, id, pos, size, style, name );
|
PreCreation( parent, id, pos, size, style, name );
|
||||||
|
|
||||||
m_modalShowing = ((m_windowStyle & wxDIALOG_MODAL) == wxDIALOG_MODAL);
|
|
||||||
|
|
||||||
m_widget = gtk_window_new( GTK_WINDOW_TOPLEVEL );
|
m_widget = gtk_window_new( GTK_WINDOW_TOPLEVEL );
|
||||||
GTK_WIDGET_UNSET_FLAGS( m_widget, GTK_CAN_FOCUS );
|
GTK_WIDGET_UNSET_FLAGS( m_widget, GTK_CAN_FOCUS );
|
||||||
|
|
||||||
@@ -189,7 +188,7 @@ void wxDialog::OnCloseWindow(wxCloseEvent& event)
|
|||||||
|
|
||||||
bool wxDialog::Show( bool show )
|
bool wxDialog::Show( bool show )
|
||||||
{
|
{
|
||||||
if (!show && m_modalShowing)
|
if (!show && IsModal() && m_modalShowing)
|
||||||
{
|
{
|
||||||
EndModal( wxID_CANCEL );
|
EndModal( wxID_CANCEL );
|
||||||
};
|
};
|
||||||
@@ -198,25 +197,31 @@ bool wxDialog::Show( bool show )
|
|||||||
|
|
||||||
if (show) InitDialog();
|
if (show) InitDialog();
|
||||||
|
|
||||||
if (show && m_modalShowing)
|
|
||||||
{
|
|
||||||
gtk_grab_add( m_widget );
|
|
||||||
gtk_main();
|
|
||||||
gtk_grab_remove( m_widget );
|
|
||||||
};
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
};
|
};
|
||||||
|
|
||||||
int wxDialog::ShowModal(void)
|
int wxDialog::ShowModal(void)
|
||||||
{
|
{
|
||||||
|
if (m_modalShowing) return GetReturnCode();
|
||||||
|
|
||||||
Show( TRUE );
|
Show( TRUE );
|
||||||
|
|
||||||
|
m_modalShowing = TRUE;
|
||||||
|
|
||||||
|
gtk_grab_add( m_widget );
|
||||||
|
gtk_main();
|
||||||
|
gtk_grab_remove( m_widget );
|
||||||
|
|
||||||
return GetReturnCode();
|
return GetReturnCode();
|
||||||
};
|
};
|
||||||
|
|
||||||
void wxDialog::EndModal( int retCode )
|
void wxDialog::EndModal( int retCode )
|
||||||
{
|
{
|
||||||
SetReturnCode( retCode );
|
SetReturnCode( retCode );
|
||||||
|
|
||||||
|
if (!m_modalShowing) return;
|
||||||
|
m_modalShowing = FALSE;
|
||||||
|
|
||||||
gtk_main_quit();
|
gtk_main_quit();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -442,3 +442,16 @@ void wxFrame::SetSizeHints(int minW, int minH, int maxW, int maxH, int WXUNUSED(
|
|||||||
gdk_window_set_hints( m_wxwindow->window, -1, -1,
|
gdk_window_set_hints( m_wxwindow->window, -1, -1,
|
||||||
minW, minH, maxW, maxH, GDK_HINT_MIN_SIZE | GDK_HINT_MIN_SIZE );
|
minW, minH, maxW, maxH, GDK_HINT_MIN_SIZE | GDK_HINT_MIN_SIZE );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wxFrame::SetIcon( const wxIcon &icon )
|
||||||
|
{
|
||||||
|
m_icon = icon;
|
||||||
|
if (!icon.Ok()) return;
|
||||||
|
|
||||||
|
wxMask *mask = icon.GetMask();
|
||||||
|
GdkBitmap *bm = NULL;
|
||||||
|
if (mask) bm = mask->GetBitmap();
|
||||||
|
|
||||||
|
gdk_window_set_icon( m_widget->window, NULL, icon.GetPixmap(), bm );
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -48,11 +48,11 @@ void wxMenuBar::Append( wxMenu *menu, const wxString &title )
|
|||||||
m_menus.Append( menu );
|
m_menus.Append( menu );
|
||||||
menu->m_title = title; // ??????
|
menu->m_title = title; // ??????
|
||||||
|
|
||||||
size_t pos;
|
int pos;
|
||||||
do {
|
do {
|
||||||
pos = menu->m_title.First( '&' );
|
pos = menu->m_title.First( '&' );
|
||||||
if (pos != wxString::npos) menu->m_title.Remove( pos, 1 );
|
if (pos != -1) menu->m_title.Remove( pos, 1 );
|
||||||
} while (pos != wxString::npos);
|
} while (pos != -1);
|
||||||
|
|
||||||
GtkWidget *root_menu;
|
GtkWidget *root_menu;
|
||||||
root_menu = gtk_menu_item_new_with_label( WXSTRINGCAST(menu->m_title) );
|
root_menu = gtk_menu_item_new_with_label( WXSTRINGCAST(menu->m_title) );
|
||||||
@@ -262,11 +262,11 @@ int wxMenu::FindItem( const wxString itemString ) const
|
|||||||
{
|
{
|
||||||
wxString s( itemString );
|
wxString s( itemString );
|
||||||
|
|
||||||
size_t pos;
|
int pos;
|
||||||
do {
|
do {
|
||||||
pos = s.First( '&' );
|
pos = s.First( '&' );
|
||||||
if (pos != wxString::npos) s.Remove( pos, 1 );
|
if (pos != -1) s.Remove( pos, 1 );
|
||||||
} while (pos != wxString::npos);
|
} while (pos != -1);
|
||||||
|
|
||||||
wxNode *node = m_items.First();
|
wxNode *node = m_items.First();
|
||||||
while (node)
|
while (node)
|
||||||
|
Reference in New Issue
Block a user