changed make_int, make_exp .. to wxmake_int..

fixed small listbox thing
  fixed layout probs of wxFrame
  small DnD updates
  small DialogEd optical correction
  small ODBC updates
  added wxListBox DClick Text in controls sample
  updated wxGTK.spec


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1445 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
1999-01-21 19:02:18 +00:00
parent f3a6507198
commit 5b077d483b
24 changed files with 482 additions and 425 deletions

View File

@@ -88,12 +88,12 @@
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
char *proio_cons(char *, char *); char *proio_cons(char *, char *);
char * make_integer(char *); char * wxmake_integer(char *);
char * make_word(char *); char * wxmake_word(char *);
char * make_string(char *); char * wxmake_string(char *);
char * make_real(char *, char *); char * wxmake_real(char *, char *);
char * make_exp(char *, char *); char * wxmake_exp(char *, char *);
char * make_exp2(char *, char *, char*); char * wxmake_exp2(char *, char *, char*);
void add_expr(char *); void add_expr(char *);
void process_command(char *); void process_command(char *);
void syntax_error(char *); void syntax_error(char *);
@@ -101,23 +101,23 @@ void syntax_error(char *);
#else #else
#if __BORLANDC__ #if __BORLANDC__
char *proio_cons(char *, char *); char *proio_cons(char *, char *);
char * make_integer(char *); char * wxmake_integer(char *);
char * make_word(char *); char * wxmake_word(char *);
char * make_string(char *); char * wxmake_string(char *);
char * make_real(char *, char *); char * wxmake_real(char *, char *);
char * make_exp(char *, char *); char * wxmake_exp(char *, char *);
char * make_exp2(char *, char *, char*); char * wxmake_exp2(char *, char *, char*);
void add_expr(char *); void add_expr(char *);
void process_command(char *); void process_command(char *);
void syntax_error(char *); void syntax_error(char *);
#else #else
char *proio_cons(); char *proio_cons();
char * make_integer(); char * wxmake_integer();
char * make_word(); char * wxmake_word();
char * make_string(); char * wxmake_string();
char * make_real(); char * wxmake_real();
char * make_exp(); char * wxmake_exp();
char * make_exp2(); char * wxmake_exp2();
void add_expr(); void add_expr();
void process_command(); void process_command();

View File

@@ -60,6 +60,7 @@ class wxDropTarget: public wxObject
virtual void OnEnter() { } virtual void OnEnter() { }
virtual void OnLeave() { } virtual void OnLeave() { }
virtual void OnMouseMove( long WXUNUSED(x), long WXUNUSED(y) ) { }
virtual bool OnDrop( long x, long y, const void *data, size_t size ) = 0; virtual bool OnDrop( long x, long y, const void *data, size_t size ) = 0;
// Override these to indicate what kind of data you support: // Override these to indicate what kind of data you support:

View File

@@ -60,6 +60,7 @@ class wxDropTarget: public wxObject
virtual void OnEnter() { } virtual void OnEnter() { }
virtual void OnLeave() { } virtual void OnLeave() { }
virtual void OnMouseMove( long WXUNUSED(x), long WXUNUSED(y) ) { }
virtual bool OnDrop( long x, long y, const void *data, size_t size ) = 0; virtual bool OnDrop( long x, long y, const void *data, size_t size ) = 0;
// Override these to indicate what kind of data you support: // Override these to indicate what kind of data you support:

View File

@@ -62,6 +62,7 @@ class MyPanel: public wxPanel
void OnSize( wxSizeEvent& event ); void OnSize( wxSizeEvent& event );
void OnListBox( wxCommandEvent &event ); void OnListBox( wxCommandEvent &event );
void OnListBoxDoubleClick( wxCommandEvent &event );
void OnListBoxButtons( wxCommandEvent &event ); void OnListBoxButtons( wxCommandEvent &event );
void OnChoice( wxCommandEvent &event ); void OnChoice( wxCommandEvent &event );
void OnChoiceButtons( wxCommandEvent &event ); void OnChoiceButtons( wxCommandEvent &event );
@@ -209,6 +210,7 @@ BEGIN_EVENT_TABLE(MyPanel, wxPanel)
EVT_SIZE ( MyPanel::OnSize) EVT_SIZE ( MyPanel::OnSize)
EVT_NOTEBOOK_PAGE_CHANGED(ID_NOTEBOOK, MyPanel::OnPageChanged) EVT_NOTEBOOK_PAGE_CHANGED(ID_NOTEBOOK, MyPanel::OnPageChanged)
EVT_LISTBOX (ID_LISTBOX, MyPanel::OnListBox) EVT_LISTBOX (ID_LISTBOX, MyPanel::OnListBox)
EVT_LISTBOX_DCLICK(ID_LISTBOX, MyPanel::OnListBoxDoubleClick)
EVT_BUTTON (ID_LISTBOX_SEL_NUM, MyPanel::OnListBoxButtons) EVT_BUTTON (ID_LISTBOX_SEL_NUM, MyPanel::OnListBoxButtons)
EVT_BUTTON (ID_LISTBOX_SEL_STR, MyPanel::OnListBoxButtons) EVT_BUTTON (ID_LISTBOX_SEL_STR, MyPanel::OnListBoxButtons)
EVT_BUTTON (ID_LISTBOX_CLEAR, MyPanel::OnListBoxButtons) EVT_BUTTON (ID_LISTBOX_CLEAR, MyPanel::OnListBoxButtons)
@@ -247,10 +249,10 @@ END_EVENT_TABLE()
MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) : MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) :
wxPanel( frame, -1, wxPoint(x, y), wxSize(w, h) ) wxPanel( frame, -1, wxPoint(x, y), wxSize(w, h) )
{ {
SetBackgroundColour("cadet blue"); // SetBackgroundColour("cadet blue");
m_text = new wxTextCtrl( this, -1, "This is the log window.\n", wxPoint(0,50), wxSize(100,50), wxTE_MULTILINE ); m_text = new wxTextCtrl( this, -1, "This is the log window.\n", wxPoint(0,50), wxSize(100,50), wxTE_MULTILINE );
m_text->SetBackgroundColour("wheat"); // m_text->SetBackgroundColour("wheat");
m_notebook = new wxNotebook( this, ID_NOTEBOOK, wxPoint(0,0), wxSize(200,150) ); m_notebook = new wxNotebook( this, ID_NOTEBOOK, wxPoint(0,0), wxSize(200,150) );
@@ -319,30 +321,30 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) :
wxButton *button = (wxButton*)NULL; wxButton *button = (wxButton*)NULL;
m_notebook->SetBackgroundColour("cadet blue"); // m_notebook->SetBackgroundColour("cadet blue");
wxPanel *panel = (wxPanel*) NULL; wxPanel *panel = (wxPanel*) NULL;
panel = new wxPanel(m_notebook); panel = new wxPanel(m_notebook);
panel->SetBackgroundColour("cadet blue"); // panel->SetBackgroundColour("cadet blue");
panel->SetForegroundColour("blue"); // panel->SetForegroundColour("blue");
m_listbox = new wxListBox( panel, ID_LISTBOX, wxPoint(10,10), wxSize(120,70), 5, choices ); m_listbox = new wxListBox( panel, ID_LISTBOX, wxPoint(10,10), wxSize(120,70), 5, choices );
m_listbox->SetBackgroundColour("wheat"); // m_listbox->SetBackgroundColour("wheat");
(void)new wxButton( panel, ID_LISTBOX_SEL_NUM, "Select #2", wxPoint(180,30), wxSize(140,30) ); (void)new wxButton( panel, ID_LISTBOX_SEL_NUM, "Select #2", wxPoint(180,30), wxSize(140,30) );
(void)new wxButton( panel, ID_LISTBOX_SEL_STR, "Select 'This'", wxPoint(340,30), wxSize(140,30) ); (void)new wxButton( panel, ID_LISTBOX_SEL_STR, "Select 'This'", wxPoint(340,30), wxSize(140,30) );
(void)new wxButton( panel, ID_LISTBOX_CLEAR, "Clear", wxPoint(180,80), wxSize(140,30) ); (void)new wxButton( panel, ID_LISTBOX_CLEAR, "Clear", wxPoint(180,80), wxSize(140,30) );
(void)new wxButton( panel, ID_LISTBOX_APPEND, "Append 'Hi!'", wxPoint(340,80), wxSize(140,30) ); (void)new wxButton( panel, ID_LISTBOX_APPEND, "Append 'Hi!'", wxPoint(340,80), wxSize(140,30) );
(void)new wxButton( panel, ID_LISTBOX_DELETE, "Delete selected item", wxPoint(180,130), wxSize(140,30) ); (void)new wxButton( panel, ID_LISTBOX_DELETE, "Delete selected item", wxPoint(180,130), wxSize(140,30) );
button = new wxButton( panel, ID_LISTBOX_FONT, "Set Italic font", wxPoint(340,130), wxSize(140,30) ); button = new wxButton( panel, ID_LISTBOX_FONT, "Set Italic font", wxPoint(340,130), wxSize(140,30) );
button->SetForegroundColour( "red" ); // button->SetForegroundColour( "red" );
m_checkbox = new wxCheckBox( panel, ID_LISTBOX_ENABLE, "Disable", wxPoint(20,130), wxSize(140,30) ); m_checkbox = new wxCheckBox( panel, ID_LISTBOX_ENABLE, "Disable", wxPoint(20,130), wxSize(140,30) );
m_checkbox->SetValue(FALSE); m_checkbox->SetValue(FALSE);
m_notebook->AddPage(panel, "wxList", FALSE, Image_List); m_notebook->AddPage(panel, "wxList", FALSE, Image_List);
panel = new wxPanel(m_notebook); panel = new wxPanel(m_notebook);
panel->SetBackgroundColour("cadet blue"); // panel->SetBackgroundColour("cadet blue");
panel->SetForegroundColour("blue"); // panel->SetForegroundColour("blue");
m_choice = new wxChoice( panel, ID_CHOICE, wxPoint(10,10), wxSize(120,-1), 5, choices ); m_choice = new wxChoice( panel, ID_CHOICE, wxPoint(10,10), wxSize(120,-1), 5, choices );
m_choice->SetBackgroundColour("wheat"); // m_choice->SetBackgroundColour("wheat");
(void)new wxButton( panel, ID_CHOICE_SEL_NUM, "Select #2", wxPoint(180,30), wxSize(140,30) ); (void)new wxButton( panel, ID_CHOICE_SEL_NUM, "Select #2", wxPoint(180,30), wxSize(140,30) );
(void)new wxButton( panel, ID_CHOICE_SEL_STR, "Select 'This'", wxPoint(340,30), wxSize(140,30) ); (void)new wxButton( panel, ID_CHOICE_SEL_STR, "Select 'This'", wxPoint(340,30), wxSize(140,30) );
(void)new wxButton( panel, ID_CHOICE_CLEAR, "Clear", wxPoint(180,80), wxSize(140,30) ); (void)new wxButton( panel, ID_CHOICE_CLEAR, "Clear", wxPoint(180,80), wxSize(140,30) );
@@ -353,10 +355,10 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) :
m_notebook->AddPage(panel, "wxChoice", FALSE, Image_Choice); m_notebook->AddPage(panel, "wxChoice", FALSE, Image_Choice);
panel = new wxPanel(m_notebook); panel = new wxPanel(m_notebook);
panel->SetBackgroundColour("cadet blue"); // panel->SetBackgroundColour("cadet blue");
panel->SetForegroundColour("blue"); // panel->SetForegroundColour("blue");
m_combo = new wxComboBox( panel, ID_COMBO, "This", wxPoint(10,10), wxSize(120,-1), 5, choices ); m_combo = new wxComboBox( panel, ID_COMBO, "This", wxPoint(10,10), wxSize(120,-1), 5, choices );
m_combo->SetBackgroundColour("wheat"); // m_combo->SetBackgroundColour("wheat");
(void)new wxButton( panel, ID_COMBO_SEL_NUM, "Select #2", wxPoint(180,30), wxSize(140,30) ); (void)new wxButton( panel, ID_COMBO_SEL_NUM, "Select #2", wxPoint(180,30), wxSize(140,30) );
(void)new wxButton( panel, ID_COMBO_SEL_STR, "Select 'This'", wxPoint(340,30), wxSize(140,30) ); (void)new wxButton( panel, ID_COMBO_SEL_STR, "Select 'This'", wxPoint(340,30), wxSize(140,30) );
(void)new wxButton( panel, ID_COMBO_CLEAR, "Clear", wxPoint(180,80), wxSize(140,30) ); (void)new wxButton( panel, ID_COMBO_CLEAR, "Clear", wxPoint(180,80), wxSize(140,30) );
@@ -367,11 +369,11 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) :
m_notebook->AddPage(panel, "wxComboBox", FALSE, Image_Combo); m_notebook->AddPage(panel, "wxComboBox", FALSE, Image_Combo);
panel = new wxPanel(m_notebook); panel = new wxPanel(m_notebook);
panel->SetBackgroundColour("cadet blue"); // panel->SetBackgroundColour("cadet blue");
panel->SetForegroundColour("blue"); // panel->SetForegroundColour("blue");
wxTextCtrl *tc = new wxTextCtrl( panel, ID_TEXT, "Write text here.", wxPoint(10,10), wxSize(320,28)); wxTextCtrl *tc = new wxTextCtrl( panel, ID_TEXT, "Write text here.", wxPoint(10,10), wxSize(320,28));
(*tc) << " More text."; (*tc) << " More text.";
tc->SetBackgroundColour("wheat"); // tc->SetBackgroundColour("wheat");
m_multitext = new wxTextCtrl( panel, ID_TEXT, "And here.", wxPoint(10,50), wxSize(320,160), wxTE_MULTILINE ); m_multitext = new wxTextCtrl( panel, ID_TEXT, "And here.", wxPoint(10,50), wxSize(320,160), wxTE_MULTILINE );
(*m_multitext) << " More text."; (*m_multitext) << " More text.";
m_multitext->SetBackgroundColour("wheat"); m_multitext->SetBackgroundColour("wheat");
@@ -387,16 +389,16 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) :
}; };
panel = new wxPanel(m_notebook); panel = new wxPanel(m_notebook);
panel->SetBackgroundColour("cadet blue"); // panel->SetBackgroundColour("cadet blue");
panel->SetForegroundColour("blue"); // panel->SetForegroundColour("blue");
m_radio = new wxRadioBox( panel, ID_RADIOBOX, "That", wxPoint(10,160), wxSize(-1,-1), 2, choices2, 1, wxRA_SPECIFY_ROWS ); m_radio = new wxRadioBox( panel, ID_RADIOBOX, "That", wxPoint(10,160), wxSize(-1,-1), 2, choices2, 1, wxRA_SPECIFY_ROWS );
m_radio->SetBackgroundColour("wheat"); // m_radio->SetBackgroundColour("wheat");
m_radio = new wxRadioBox( panel, ID_RADIOBOX, "This", wxPoint(10,10), wxSize(-1,-1), 5, choices, 1, wxRA_SPECIFY_COLS ); m_radio = new wxRadioBox( panel, ID_RADIOBOX, "This", wxPoint(10,10), wxSize(-1,-1), 5, choices, 1, wxRA_SPECIFY_COLS );
m_radio->SetBackgroundColour("wheat"); // m_radio->SetBackgroundColour("wheat");
(void)new wxButton( panel, ID_RADIOBOX_SEL_NUM, "Select #2", wxPoint(180,30), wxSize(140,30) ); (void)new wxButton( panel, ID_RADIOBOX_SEL_NUM, "Select #2", wxPoint(180,30), wxSize(140,30) );
(void)new wxButton( panel, ID_RADIOBOX_SEL_STR, "Select 'This'", wxPoint(180,80), wxSize(140,30) ); (void)new wxButton( panel, ID_RADIOBOX_SEL_STR, "Select 'This'", wxPoint(180,80), wxSize(140,30) );
m_fontButton = new wxButton( panel, ID_SET_FONT, "Set more Italic font", wxPoint(340,30), wxSize(140,30) ); m_fontButton = new wxButton( panel, ID_SET_FONT, "Set more Italic font", wxPoint(340,30), wxSize(140,30) );
m_fontButton->SetForegroundColour("blue"); // m_fontButton->SetForegroundColour("blue");
(void)new wxButton( panel, ID_RADIOBOX_FONT, "Set Italic font", wxPoint(340,80), wxSize(140,30) ); (void)new wxButton( panel, ID_RADIOBOX_FONT, "Set Italic font", wxPoint(340,80), wxSize(140,30) );
(void)new wxCheckBox( panel, ID_RADIOBOX_ENABLE, "Disable", wxPoint(340,130), wxSize(140,30) ); (void)new wxCheckBox( panel, ID_RADIOBOX_ENABLE, "Disable", wxPoint(340,130), wxSize(140,30) );
wxRadioButton *rb = new wxRadioButton( panel, ID_RADIOBUTTON_1, "Radiobutton1", wxPoint(210,170), wxSize(110,30) ); wxRadioButton *rb = new wxRadioButton( panel, ID_RADIOBUTTON_1, "Radiobutton1", wxPoint(210,170), wxSize(110,30) );
@@ -405,13 +407,13 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) :
m_notebook->AddPage(panel, "wxRadioBox", FALSE, Image_Radio); m_notebook->AddPage(panel, "wxRadioBox", FALSE, Image_Radio);
panel = new wxPanel(m_notebook); panel = new wxPanel(m_notebook);
panel->SetBackgroundColour("cadet blue"); // panel->SetBackgroundColour("cadet blue");
panel->SetForegroundColour("blue"); // panel->SetForegroundColour("blue");
(void)new wxStaticBox( panel, -1, "wxGauge and wxSlider", wxPoint(10,10), wxSize(180,130) ); (void)new wxStaticBox( panel, -1, "wxGauge and wxSlider", wxPoint(10,10), wxSize(180,130) );
m_gauge = new wxGauge( panel, -1, 200, wxPoint(18,50), wxSize(155,-1) ); m_gauge = new wxGauge( panel, -1, 200, wxPoint(18,50), wxSize(155,-1) );
m_gauge->SetBackgroundColour("wheat"); // m_gauge->SetBackgroundColour("wheat");
m_slider = new wxSlider( panel, ID_SLIDER, 0, 0, 200, wxPoint(18,90), wxSize(155,-1) ); m_slider = new wxSlider( panel, ID_SLIDER, 0, 0, 200, wxPoint(18,90), wxSize(155,-1) );
m_slider->SetBackgroundColour("wheat"); // m_slider->SetBackgroundColour("wheat");
(void)new wxStaticBox( panel, -1, "Explanation", wxPoint(200,10), wxSize(290,130) ); (void)new wxStaticBox( panel, -1, "Explanation", wxPoint(200,10), wxSize(290,130) );
(void)new wxStaticText( panel, -1, (void)new wxStaticText( panel, -1,
"In order see the gauge (aka progress bar)\n" "In order see the gauge (aka progress bar)\n"
@@ -426,9 +428,9 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) :
#endif #endif
); );
m_spintext = new wxTextCtrl( panel, -1, "0", wxPoint(20,160), wxSize(80,-1) ); m_spintext = new wxTextCtrl( panel, -1, "0", wxPoint(20,160), wxSize(80,-1) );
m_spintext->SetBackgroundColour("wheat"); // m_spintext->SetBackgroundColour("wheat");
m_spinbutton = new wxSpinButton( panel, ID_SPIN, wxPoint(103,159), wxSize(-1,-1) ); m_spinbutton = new wxSpinButton( panel, ID_SPIN, wxPoint(103,159), wxSize(-1,-1) );
m_spinbutton->SetBackgroundColour("wheat"); // m_spinbutton->SetBackgroundColour("wheat");
m_spinbutton->SetRange(0,100); m_spinbutton->SetRange(0,100);
m_notebook->AddPage(panel, "wxGauge", FALSE, Image_Gauge); m_notebook->AddPage(panel, "wxGauge", FALSE, Image_Gauge);
@@ -531,6 +533,13 @@ void MyPanel::OnListBox( wxCommandEvent &event )
m_text->WriteText( "\n" ); m_text->WriteText( "\n" );
} }
void MyPanel::OnListBoxDoubleClick( wxCommandEvent &event )
{
m_text->WriteText( "ListBox double click string is: " );
m_text->WriteText( event.GetString() );
m_text->WriteText( "\n" );
}
void MyPanel::OnListBoxButtons( wxCommandEvent &event ) void MyPanel::OnListBoxButtons( wxCommandEvent &event )
{ {
switch (event.GetId()) switch (event.GetId())

View File

@@ -41,23 +41,22 @@
#include "db.xpm" #include "db.xpm"
#endif #endif
#include <stdio.h> // Included strictly for reading the text file with the database parameters #include <stdio.h> /* Included strictly for reading the text file with the database parameters */
#include <wx/db.h> // Required in the file which will get the data source connection #include <wx/db.h> /* Required in the file which will get the data source connection */
#include <wx/dbtable.h> // Has the wxTable object from which all data objects will inherit their data table functionality #include <wx/dbtable.h> /* Has the wxTable object from which all data objects will inherit their data table functionality */
extern DbList* WXDLLEXPORT PtrBegDbList; // from db.cpp, used in getting back error results from db connections extern DbList* WXDLLEXPORT PtrBegDbList; /* from db.cpp, used in getting back error results from db connections */
#include "dbtest.h" // Header file for this demonstration program #include "dbtest.h" /* Header file for this demonstration program */
#include "listdb.h" // Code to support the "Lookup" button on the editor dialog #include "listdb.h" /* Code to support the "Lookup" button on the editor dialog */
IMPLEMENT_APP(DatabaseDemoApp) IMPLEMENT_APP(DatabaseDemoApp)
extern char ListDB_Selection[]; // Used to return the first column value for the selected line from the listDB routines extern char ListDB_Selection[]; /* Used to return the first column value for the selected line from the listDB routines */
extern char ListDB_Selection2[]; // Used to return the second column value for the selected line from the listDB routines extern char ListDB_Selection2[]; /* Used to return the second column value for the selected line from the listDB routines */
DatabaseDemoFrame *DemoFrame; // Pointer to the main frame
DatabaseDemoFrame *DemoFrame; /* Pointer to the main frame */
/* Pointer to the main database connection used in the program. This /* Pointer to the main database connection used in the program. This
* pointer would normally be used for doing things as database lookups * pointer would normally be used for doing things as database lookups
@@ -79,9 +78,9 @@ DatabaseDemoFrame *DemoFrame; // Pointer to the main frame
* table object which will do a CommitTrans() or RollbackTrans() that a * table object which will do a CommitTrans() or RollbackTrans() that a
* new wxDB object be created and used for it. * new wxDB object be created and used for it.
*/ */
wxDB *READONLY_DB; wxDB *READONLY_DB;
/* /*
* This function will return the exact string(s) from the database engine * This function will return the exact string(s) from the database engine
* indicating all error conditions which have just occured during the * indicating all error conditions which have just occured during the
@@ -94,6 +93,7 @@ wxDB *READONLY_DB;
* NOTE: The value returned by this function is for temporary use only and * NOTE: The value returned by this function is for temporary use only and
* should be copied for long term use * should be copied for long term use
*/ */
char *GetExtendedDBErrorMsg(char *ErrFile, int ErrLine) char *GetExtendedDBErrorMsg(char *ErrFile, int ErrLine)
{ {
static wxString msg; static wxString msg;
@@ -102,9 +102,7 @@ char *GetExtendedDBErrorMsg(char *ErrFile, int ErrLine)
if (ErrFile || ErrLine) if (ErrFile || ErrLine)
{ {
msg += "\n"; msg += "File: ";
msg.Append ('-',80);
msg += "\nFile: ";
msg += ErrFile; msg += ErrFile;
msg += " Line: "; msg += " Line: ";
tStr.Printf("%d",ErrLine); tStr.Printf("%d",ErrLine);
@@ -112,12 +110,11 @@ char *GetExtendedDBErrorMsg(char *ErrFile, int ErrLine)
msg += "\n"; msg += "\n";
} }
msg.Append ('-',80); msg.Append ("\nODBC errors:\n");
msg.Append ("\nODBC ERRORS\n");
msg.Append ('-',80);
msg += "\n"; msg += "\n";
// Scan through each database connection displaying
// any ODBC errors that have occured. /* Scan through each database connection displaying
* any ODBC errors that have occured. */
for (DbList *pDbList = PtrBegDbList; pDbList; pDbList = pDbList->PtrNext) for (DbList *pDbList = PtrBegDbList; pDbList; pDbList = pDbList->PtrNext)
{ {
// Skip over any free connections // Skip over any free connections
@@ -544,8 +541,8 @@ CeditorDlg::CeditorDlg(wxWindow *parent) : wxPanel (parent, 1, 1, 460, 455)
// Build the dialog // Build the dialog
wxStaticBox *FunctionGrp = new wxStaticBox(this, EDITOR_DIALOG_FN_GROUP, "", wxPoint(15, 1), wxSize(497, 69), 0, "FunctionGrp"); (void)new wxStaticBox(this, EDITOR_DIALOG_FN_GROUP, "", wxPoint(15, 1), wxSize(497, 69), 0, "FunctionGrp");
wxStaticBox *SearchGrp = new wxStaticBox(this, EDITOR_DIALOG_SEARCH_GROUP, "", wxPoint(417, 1), wxSize(95, 242), 0, "SearchGrp"); (void)new wxStaticBox(this, EDITOR_DIALOG_SEARCH_GROUP, "", wxPoint(417, 1), wxSize(95, 242), 0, "SearchGrp");
pCreateBtn = new wxButton(this, EDITOR_DIALOG_CREATE, "&Create", wxPoint(25, 21), wxSize(70, 35), 0, wxDefaultValidator, "CreateBtn"); pCreateBtn = new wxButton(this, EDITOR_DIALOG_CREATE, "&Create", wxPoint(25, 21), wxSize(70, 35), 0, wxDefaultValidator, "CreateBtn");
pEditBtn = new wxButton(this, EDITOR_DIALOG_EDIT, "&Edit", wxPoint(102, 21), wxSize(70, 35), 0, wxDefaultValidator, "EditBtn"); pEditBtn = new wxButton(this, EDITOR_DIALOG_EDIT, "&Edit", wxPoint(102, 21), wxSize(70, 35), 0, wxDefaultValidator, "EditBtn");
@@ -622,7 +619,7 @@ CeditorDlg::CeditorDlg(wxWindow *parent) : wxPanel (parent, 1, 1, 460, 455)
// The constructed where clause below has a sub-query within it "SELECT MIN(NAME) FROM %s" // The constructed where clause below has a sub-query within it "SELECT MIN(NAME) FROM %s"
// to achieve a single row (in this case the first name in alphabetical order). // to achieve a single row (in this case the first name in alphabetical order).
Contact->whereStr.Printf("NAME = (SELECT MIN(NAME) FROM %s)",Contact->tableName); Contact->whereStr.Printf("NAME = (SELECT MIN(NAME) FROM %s)",Contact->tableName);
// NOTE: (const char*) returns a pointer which may not be valid later, so this is short term use only // NOTE: (const char*) returns a pointer which may not be valid later, so this is short term use only
Contact->where = (char*) (const char*) Contact->whereStr; Contact->where = (char*) (const char*) Contact->whereStr;

View File

@@ -75,7 +75,7 @@ char ListDB_Selection[LOOKUP_COL_LEN+1];
char ListDB_Selection2[LOOKUP_COL_LEN+1]; char ListDB_Selection2[LOOKUP_COL_LEN+1];
// Constants // Constants
const LISTDB_NO_SPACES_BETWEEN_COLS = 3; const int LISTDB_NO_SPACES_BETWEEN_COLS = 3;
// Clookup constructor // Clookup constructor

View File

@@ -23,7 +23,7 @@
#include <wx/dbtable.h> #include <wx/dbtable.h>
const LOOKUP_COL_LEN = 250; const int LOOKUP_COL_LEN = 250;
// Global database connection // Global database connection
extern wxDB *READONLY_DB; extern wxDB *READONLY_DB;

View File

@@ -145,7 +145,7 @@ DnDFrame::DnDFrame(wxFrame *frame, char *title, int x, int y, int w, int h)
m_strText("wxWindows drag & drop works :-)") m_strText("wxWindows drag & drop works :-)")
{ {
SetBackgroundColour(* wxWHITE); // SetBackgroundColour(* wxWHITE);
// frame icon and status bar // frame icon and status bar
SetIcon(wxICON(mondrian)); SetIcon(wxICON(mondrian));
@@ -185,7 +185,7 @@ DnDFrame::DnDFrame(wxFrame *frame, char *title, int x, int y, int w, int h)
m_ctrlLog = new wxTextCtrl(this, -1, "", pos, size, m_ctrlLog = new wxTextCtrl(this, -1, "", pos, size,
wxTE_MULTILINE | wxTE_READONLY | wxTE_MULTILINE | wxTE_READONLY |
wxSUNKEN_BORDER| wxHSCROLL); wxSUNKEN_BORDER );
// redirect log messages to the text window (don't forget to delete it!) // redirect log messages to the text window (don't forget to delete it!)
m_pLog = new wxLogTextCtrl(m_ctrlLog); m_pLog = new wxLogTextCtrl(m_ctrlLog);
@@ -237,7 +237,7 @@ void DnDFrame::OnPaint(wxPaintEvent& /*event*/)
wxPaintDC dc(this); wxPaintDC dc(this);
dc.SetFont( wxFont( 24, wxDECORATIVE, wxNORMAL, wxNORMAL ) ); dc.SetFont( wxFont( 24, wxDECORATIVE, wxNORMAL, wxNORMAL ) );
dc.DrawText( "Drag text from here!", 20, h-30 ); dc.DrawText( "Drag text from here!", 20, h-22 );
} }
void DnDFrame::OnDrag(wxCommandEvent& /* event */) void DnDFrame::OnDrag(wxCommandEvent& /* event */)

View File

@@ -158,7 +158,6 @@ install::
$(INSTALL) -d $(libdir)/wx/include/wx/gtk ; \ $(INSTALL) -d $(libdir)/wx/include/wx/gtk ; \
mv $(includedir)/wx/gtk/setup.h $(libdir)/wx/include/wx/gtk/setup.h ; \ mv $(includedir)/wx/gtk/setup.h $(libdir)/wx/include/wx/gtk/setup.h ; \
fi fi
@echo " Moving setup.h to library path"
@if test "@TOOLKIT@" = "MOTIF" ; then \ @if test "@TOOLKIT@" = "MOTIF" ; then \
cd $(WXBASEDIR)/src ; \ cd $(WXBASEDIR)/src ; \
$(INSTALL) -d $(libdir)/wx/include/wx/motif ; \ $(INSTALL) -d $(libdir)/wx/include/wx/motif ; \

View File

@@ -397,7 +397,7 @@ yyreduce:
{ {
case 3: case 3:
#line 68 "parser.y" #line 68 "parser.y"
{process_command(proio_cons(make_word(yyvsp[-1].s), NULL)); free(yyvsp[-1].s);} {process_command(proio_cons(wxmake_word(yyvsp[-1].s), NULL)); free(yyvsp[-1].s);}
break; break;
case 4: case 4:
#line 70 "parser.y" #line 70 "parser.y"
@@ -409,7 +409,7 @@ case 5:
break; break;
case 6: case 6:
#line 76 "parser.y" #line 76 "parser.y"
{yyval.s = proio_cons(make_word(yyvsp[-3].s), yyvsp[-1].s); free(yyvsp[-3].s);} {yyval.s = proio_cons(wxmake_word(yyvsp[-3].s), yyvsp[-1].s); free(yyvsp[-3].s);}
break; break;
case 7: case 7:
#line 78 "parser.y" #line 78 "parser.y"
@@ -433,7 +433,7 @@ case 11:
break; break;
case 12: case 12:
#line 93 "parser.y" #line 93 "parser.y"
{yyval.s = proio_cons(make_word("="), proio_cons(make_word(yyvsp[-2].s), proio_cons(yyvsp[0].s, NULL))); {yyval.s = proio_cons(wxmake_word("="), proio_cons(wxmake_word(yyvsp[-2].s), proio_cons(yyvsp[0].s, NULL)));
free(yyvsp[-2].s); } free(yyvsp[-2].s); }
break; break;
case 13: case 13:
@@ -442,27 +442,27 @@ case 13:
break; break;
case 14: case 14:
#line 99 "parser.y" #line 99 "parser.y"
{yyval.s = make_word(yyvsp[0].s); free(yyvsp[0].s);} {yyval.s = wxmake_word(yyvsp[0].s); free(yyvsp[0].s);}
break; break;
case 15: case 15:
#line 101 "parser.y" #line 101 "parser.y"
{yyval.s = make_string(yyvsp[0].s); free(yyvsp[0].s);} {yyval.s = wxmake_string(yyvsp[0].s); free(yyvsp[0].s);}
break; break;
case 16: case 16:
#line 103 "parser.y" #line 103 "parser.y"
{yyval.s = make_integer(yyvsp[0].s); free(yyvsp[0].s);} {yyval.s = wxmake_integer(yyvsp[0].s); free(yyvsp[0].s);}
break; break;
case 17: case 17:
#line 105 "parser.y" #line 105 "parser.y"
{yyval.s = make_real(yyvsp[-2].s, yyvsp[0].s); free(yyvsp[-2].s); free(yyvsp[0].s); } {yyval.s = wxmake_real(yyvsp[-2].s, yyvsp[0].s); free(yyvsp[-2].s); free(yyvsp[0].s); }
break; break;
case 18: case 18:
#line 107 "parser.y" #line 107 "parser.y"
{yyval.s = make_exp(yyvsp[-2].s, yyvsp[0].s); free(yyvsp[-2].s); free(yyvsp[0].s); } {yyval.s = wxmake_exp(yyvsp[-2].s, yyvsp[0].s); free(yyvsp[-2].s); free(yyvsp[0].s); }
break; break;
case 19: case 19:
#line 110 "parser.y" #line 110 "parser.y"
{yyval.s = make_exp2(yyvsp[-4].s, yyvsp[-2].s, yyvsp[0].s); free(yyvsp[-4].s); free(yyvsp[-2].s); {yyval.s = wxmake_exp2(yyvsp[-4].s, yyvsp[-2].s, yyvsp[0].s); free(yyvsp[-4].s); free(yyvsp[-2].s);
free(yyvsp[0].s); } free(yyvsp[0].s); }
break; break;
case 20: case 20:

View File

@@ -508,9 +508,9 @@ UWORD wxTable::GetRowNum(void)
/********** wxTable::bindInsertParams() **********/ /********** wxTable::bindInsertParams() **********/
bool wxTable::bindInsertParams(void) bool wxTable::bindInsertParams(void)
{ {
SWORD fSqlType; SWORD fSqlType = 0;
UDWORD precision; UDWORD precision = 0;
SWORD scale; SWORD scale = 0;
// Bind each column (that can be inserted) of the table to a parameter marker // Bind each column (that can be inserted) of the table to a parameter marker
for (int i = 0; i < noCols; i++) for (int i = 0; i < noCols; i++)
@@ -563,9 +563,9 @@ bool wxTable::bindInsertParams(void)
/********** wxTable::bindUpdateParams() **********/ /********** wxTable::bindUpdateParams() **********/
bool wxTable::bindUpdateParams(void) bool wxTable::bindUpdateParams(void)
{ {
SWORD fSqlType; SWORD fSqlType = 0;
UDWORD precision; UDWORD precision = 0;
SWORD scale; SWORD scale = 0;
// Bind each UPDATEABLE column of the table to a parameter marker // Bind each UPDATEABLE column of the table to a parameter marker
for (int i = 0, colNo = 1; i < noCols; i++) for (int i = 0, colNo = 1; i < noCols; i++)

View File

@@ -393,7 +393,7 @@ yyreduce:
{ {
case 3: case 3:
#line 68 "parser.y" #line 68 "parser.y"
{process_command(proio_cons(make_word(yyvsp[-1].s), NULL)); free(yyvsp[-1].s);} {process_command(proio_cons(wxmake_word(yyvsp[-1].s), NULL)); free(yyvsp[-1].s);}
break; break;
case 4: case 4:
#line 70 "parser.y" #line 70 "parser.y"
@@ -405,7 +405,7 @@ case 5:
break; break;
case 6: case 6:
#line 76 "parser.y" #line 76 "parser.y"
{yyval.s = proio_cons(make_word(yyvsp[-3].s), yyvsp[-1].s); free(yyvsp[-3].s);} {yyval.s = proio_cons(wxmake_word(yyvsp[-3].s), yyvsp[-1].s); free(yyvsp[-3].s);}
break; break;
case 7: case 7:
#line 78 "parser.y" #line 78 "parser.y"
@@ -429,7 +429,7 @@ case 11:
break; break;
case 12: case 12:
#line 93 "parser.y" #line 93 "parser.y"
{yyval.s = proio_cons(make_word("="), proio_cons(make_word(yyvsp[-2].s), proio_cons(yyvsp[0].s, NULL))); {yyval.s = proio_cons(wxmake_word("="), proio_cons(wxmake_word(yyvsp[-2].s), proio_cons(yyvsp[0].s, NULL)));
free(yyvsp[-2].s); } free(yyvsp[-2].s); }
break; break;
case 13: case 13:
@@ -438,27 +438,27 @@ case 13:
break; break;
case 14: case 14:
#line 99 "parser.y" #line 99 "parser.y"
{yyval.s = make_word(yyvsp[0].s); free(yyvsp[0].s);} {yyval.s = wxmake_word(yyvsp[0].s); free(yyvsp[0].s);}
break; break;
case 15: case 15:
#line 101 "parser.y" #line 101 "parser.y"
{yyval.s = make_string(yyvsp[0].s); free(yyvsp[0].s);} {yyval.s = wxmake_string(yyvsp[0].s); free(yyvsp[0].s);}
break; break;
case 16: case 16:
#line 103 "parser.y" #line 103 "parser.y"
{yyval.s = make_integer(yyvsp[0].s); free(yyvsp[0].s);} {yyval.s = wxmake_integer(yyvsp[0].s); free(yyvsp[0].s);}
break; break;
case 17: case 17:
#line 105 "parser.y" #line 105 "parser.y"
{yyval.s = make_real(yyvsp[-2].s, yyvsp[0].s); free(yyvsp[-2].s); free(yyvsp[0].s); } {yyval.s = wxmake_real(yyvsp[-2].s, yyvsp[0].s); free(yyvsp[-2].s); free(yyvsp[0].s); }
break; break;
case 18: case 18:
#line 107 "parser.y" #line 107 "parser.y"
{yyval.s = make_exp(yyvsp[-2].s, yyvsp[0].s); free(yyvsp[-2].s); free(yyvsp[0].s); } {yyval.s = wxmake_exp(yyvsp[-2].s, yyvsp[0].s); free(yyvsp[-2].s); free(yyvsp[0].s); }
break; break;
case 19: case 19:
#line 110 "parser.y" #line 110 "parser.y"
{yyval.s = make_exp2(yyvsp[-4].s, yyvsp[-2].s, yyvsp[0].s); free(yyvsp[-4].s); free(yyvsp[-2].s); {yyval.s = wxmake_exp2(yyvsp[-4].s, yyvsp[-2].s, yyvsp[0].s); free(yyvsp[-4].s); free(yyvsp[-2].s);
free(yyvsp[0].s); } free(yyvsp[0].s); }
break; break;
case 20: case 20:

View File

@@ -73,7 +73,7 @@ commands : /* empty */
; ;
command : WORD PERIOD command : WORD PERIOD
{process_command(proio_cons(make_word($1), NULL)); free($1);} {process_command(proio_cons(wxmake_word($1), NULL)); free($1);}
| expr PERIOD | expr PERIOD
{process_command($1);} {process_command($1);}
| error PERIOD | error PERIOD
@@ -81,7 +81,7 @@ command : WORD PERIOD
; ;
expr : WORD OPEN arglist CLOSE expr : WORD OPEN arglist CLOSE
{$$ = proio_cons(make_word($1), $3); free($1);} {$$ = proio_cons(wxmake_word($1), $3); free($1);}
| OPEN_SQUARE CLOSE_SQUARE | OPEN_SQUARE CLOSE_SQUARE
{$$ = proio_cons(NULL, NULL);} {$$ = proio_cons(NULL, NULL);}
| OPEN_SQUARE arglist CLOSE_SQUARE | OPEN_SQUARE arglist CLOSE_SQUARE
@@ -98,24 +98,24 @@ arglist :
; ;
arg : WORD EQUALS arg1 arg : WORD EQUALS arg1
{$$ = proio_cons(make_word("="), proio_cons(make_word($1), proio_cons($3, NULL))); {$$ = proio_cons(wxmake_word("="), proio_cons(wxmake_word($1), proio_cons($3, NULL)));
free($1); } free($1); }
| arg1 | arg1
{$$ = $1; } {$$ = $1; }
arg1 : WORD arg1 : WORD
{$$ = make_word($1); free($1);} {$$ = wxmake_word($1); free($1);}
| STRING | STRING
{$$ = make_string($1); free($1);} {$$ = wxmake_string($1); free($1);}
| INTEGER | INTEGER
{$$ = make_integer($1); free($1);} {$$ = wxmake_integer($1); free($1);}
| INTEGER PERIOD INTEGER | INTEGER PERIOD INTEGER
{$$ = make_real($1, $3); free($1); free($3); } {$$ = wxmake_real($1, $3); free($1); free($3); }
| INTEGER EXP INTEGER | INTEGER EXP INTEGER
{$$ = make_exp($1, $3); free($1); free($3); } {$$ = wxmake_exp($1, $3); free($1); free($3); }
| |
INTEGER PERIOD INTEGER EXP INTEGER INTEGER PERIOD INTEGER EXP INTEGER
{$$ = make_exp2($1, $3, $5); free($1); free($3); {$$ = wxmake_exp2($1, $3, $5); free($1); free($3);
free($5); } free($5); }
| expr | expr

View File

@@ -1138,14 +1138,14 @@ bool wxExprIsFunctor(wxExpr *expr, const wxString& functor)
* *
*/ */
char *make_integer(char *str) char *wxmake_integer(char *str)
{ {
wxExpr *x = new wxExpr(atol(str)); wxExpr *x = new wxExpr(atol(str));
return (char *)x; return (char *)x;
} }
char *make_real(char *str1, char *str2) char *wxmake_real(char *str1, char *str2)
{ {
char buf[50]; char buf[50];
@@ -1158,7 +1158,7 @@ char *make_real(char *str1, char *str2)
// extern "C" double exp10(double); // extern "C" double exp10(double);
char *make_exp(char *str1, char *str2) char *wxmake_exp(char *str1, char *str2)
{ {
double mantissa = (double)atoi(str1); double mantissa = (double)atoi(str1);
double exponent = (double)atoi(str2); double exponent = (double)atoi(str2);
@@ -1170,7 +1170,7 @@ char *make_exp(char *str1, char *str2)
return (char *)x; return (char *)x;
} }
char *make_exp2(char *str1, char *str2, char *str3) char *wxmake_exp2(char *str1, char *str2, char *str3)
{ {
char buf[50]; char buf[50];
@@ -1185,13 +1185,13 @@ char *make_exp2(char *str1, char *str2, char *str3)
return (char *)x; return (char *)x;
} }
char *make_word(char *str) char *wxmake_word(char *str)
{ {
wxExpr *x = new wxExpr(wxExprWord, str); wxExpr *x = new wxExpr(wxExprWord, str);
return (char *)x; return (char *)x;
} }
char *make_string(char *str) char *wxmake_string(char *str)
{ {
char *s, *t; char *s, *t;
int len, i; int len, i;

View File

@@ -2049,155 +2049,160 @@ void wxListMainWindow::DeleteItem( long index )
void wxListMainWindow::DeleteColumn( int col ) void wxListMainWindow::DeleteColumn( int col )
{ {
wxCHECK_RET( col < (int)m_columns.GetCount(), wxCHECK_RET( col < (int)m_columns.GetCount(),
"attempting to delete inexistent column in wxListView" ); "attempting to delete inexistent column in wxListView" );
m_dirty = TRUE; m_dirty = TRUE;
wxNode *node = m_columns.Nth( col ); wxNode *node = m_columns.Nth( col );
if (node) m_columns.DeleteNode( node ); if (node) m_columns.DeleteNode( node );
} }
void wxListMainWindow::DeleteAllItems( void ) void wxListMainWindow::DeleteAllItems( void )
{ {
m_dirty = TRUE; m_dirty = TRUE;
m_current = (wxListLineData *) NULL; m_current = (wxListLineData *) NULL;
wxNode *node = m_lines.First(); wxNode *node = m_lines.First();
while (node) while (node)
{ {
wxListLineData *line = (wxListLineData*)node->Data(); wxListLineData *line = (wxListLineData*)node->Data();
DeleteLine( line ); DeleteLine( line );
node = node->Next(); node = node->Next();
} }
m_lines.Clear(); m_lines.Clear();
} }
void wxListMainWindow::DeleteEverything( void ) void wxListMainWindow::DeleteEverything( void )
{ {
m_dirty = TRUE; m_dirty = TRUE;
m_current = (wxListLineData *) NULL; m_current = (wxListLineData *) NULL;
wxNode *node = m_lines.First(); wxNode *node = m_lines.First();
while (node) while (node)
{ {
wxListLineData *line = (wxListLineData*)node->Data(); wxListLineData *line = (wxListLineData*)node->Data();
DeleteLine( line ); DeleteLine( line );
node = node->Next(); node = node->Next();
} }
m_lines.Clear(); m_lines.Clear();
m_current = (wxListLineData *) NULL; m_current = (wxListLineData *) NULL;
m_columns.Clear(); m_columns.Clear();
} }
void wxListMainWindow::EnsureVisible( long index ) void wxListMainWindow::EnsureVisible( long index )
{ {
wxListLineData *oldCurrent = m_current; wxListLineData *oldCurrent = m_current;
m_current = (wxListLineData *) NULL; m_current = (wxListLineData *) NULL;
int i = index; int i = index;
wxNode *node = m_lines.Nth( i ); wxNode *node = m_lines.Nth( i );
if (node) m_current = (wxListLineData*)node->Data(); if (node) m_current = (wxListLineData*)node->Data();
if (m_current) MoveToFocus(); if (m_current) MoveToFocus();
m_current = oldCurrent; m_current = oldCurrent;
} }
long wxListMainWindow::FindItem(long start, const wxString& str, bool WXUNUSED(partial) ) long wxListMainWindow::FindItem(long start, const wxString& str, bool WXUNUSED(partial) )
{ {
long pos = start; long pos = start;
wxString tmp = str; wxString tmp = str;
if (pos < 0) pos = 0; if (pos < 0) pos = 0;
wxNode *node = m_lines.Nth( pos ); wxNode *node = m_lines.Nth( pos );
while (node) while (node)
{ {
wxListLineData *line = (wxListLineData*)node->Data(); wxListLineData *line = (wxListLineData*)node->Data();
wxString s = ""; wxString s = "";
line->GetText( 0, s ); line->GetText( 0, s );
if (s == tmp) return pos; if (s == tmp) return pos;
node = node->Next(); node = node->Next();
pos++; pos++;
} }
return -1; return -1;
} }
long wxListMainWindow::FindItem(long start, long data) long wxListMainWindow::FindItem(long start, long data)
{ {
long pos = start; long pos = start;
if (pos < 0) pos = 0; if (pos < 0) pos = 0;
wxNode *node = m_lines.Nth( pos ); wxNode *node = m_lines.Nth( pos );
while (node) while (node)
{ {
wxListLineData *line = (wxListLineData*)node->Data(); wxListLineData *line = (wxListLineData*)node->Data();
wxListItem item; wxListItem item;
line->GetItem( 0, item ); line->GetItem( 0, item );
if (item.m_data == data) return pos; if (item.m_data == data) return pos;
node = node->Next(); node = node->Next();
pos++; pos++;
} }
return -1; return -1;
} }
long wxListMainWindow::HitTest( int x, int y, int &flags ) long wxListMainWindow::HitTest( int x, int y, int &flags )
{ {
wxNode *node = m_lines.First(); wxNode *node = m_lines.First();
int count = 0; int count = 0;
while (node) while (node)
{
wxListLineData *line = (wxListLineData*)node->Data();
long ret = line->IsHit( x, y );
if (ret & flags)
{ {
flags = ret; wxListLineData *line = (wxListLineData*)node->Data();
return count; long ret = line->IsHit( x, y );
if (ret & flags)
{
flags = ret;
return count;
}
node = node->Next();
count++;
} }
node = node->Next(); return -1;
count++;
}
return -1;
} }
void wxListMainWindow::InsertItem( wxListItem &item ) void wxListMainWindow::InsertItem( wxListItem &item )
{ {
m_dirty = TRUE; m_dirty = TRUE;
int mode = 0; int mode = 0;
if (m_mode & wxLC_REPORT) mode = wxLC_REPORT; if (m_mode & wxLC_REPORT) mode = wxLC_REPORT;
else if (m_mode & wxLC_LIST) mode = wxLC_LIST; else if (m_mode & wxLC_LIST) mode = wxLC_LIST;
else if (m_mode & wxLC_ICON) mode = wxLC_ICON; else if (m_mode & wxLC_ICON) mode = wxLC_ICON;
else if (m_mode & wxLC_SMALL_ICON) mode = wxLC_ICON; // no typo else if (m_mode & wxLC_SMALL_ICON) mode = wxLC_ICON; // no typo
wxListLineData *line = new wxListLineData( this, mode, m_hilightBrush );
if (m_mode & wxLC_REPORT) wxListLineData *line = new wxListLineData( this, mode, m_hilightBrush );
{
line->InitItems( GetColumnCount() ); if (m_mode & wxLC_REPORT)
item.m_width = GetColumnWidth( 0 )-3; {
} line->InitItems( GetColumnCount() );
else item.m_width = GetColumnWidth( 0 )-3;
line->InitItems( 1 ); }
line->SetItem( 0, item ); else
if ((item.m_itemId >= 0) && (item.m_itemId < (int)m_lines.GetCount())) {
{ line->InitItems( 1 );
wxNode *node = m_lines.Nth( item.m_itemId ); }
if (node) m_lines.Insert( node, line );
} line->SetItem( 0, item );
else if ((item.m_itemId >= 0) && (item.m_itemId < (int)m_lines.GetCount()))
{ {
m_lines.Append( line ); wxNode *node = m_lines.Nth( item.m_itemId );
} if (node) m_lines.Insert( node, line );
}
else
{
m_lines.Append( line );
}
} }
void wxListMainWindow::InsertColumn( long col, wxListItem &item ) void wxListMainWindow::InsertColumn( long col, wxListItem &item )
{ {
m_dirty = TRUE; m_dirty = TRUE;
if (m_mode & wxLC_REPORT) if (m_mode & wxLC_REPORT)
{
if (item.m_width == wxLIST_AUTOSIZE_USEHEADER) item.m_width = GetTextLength( item.m_text );
wxListHeaderData *column = new wxListHeaderData( item );
if ((col >= 0) && (col < (int)m_columns.GetCount()))
{ {
wxNode *node = m_columns.Nth( col ); if (item.m_width == wxLIST_AUTOSIZE_USEHEADER) item.m_width = GetTextLength( item.m_text );
if (node) wxListHeaderData *column = new wxListHeaderData( item );
m_columns.Insert( node, column ); if ((col >= 0) && (col < (int)m_columns.GetCount()))
{
wxNode *node = m_columns.Nth( col );
if (node)
m_columns.Insert( node, column );
}
else
{
m_columns.Append( column );
}
} }
else
{
m_columns.Append( column );
}
}
} }
wxListCtrlCompare list_ctrl_compare_func_2; wxListCtrlCompare list_ctrl_compare_func_2;
@@ -2205,21 +2210,21 @@ long list_ctrl_compare_data;
int list_ctrl_compare_func_1( const void *arg1, const void *arg2 ) int list_ctrl_compare_func_1( const void *arg1, const void *arg2 )
{ {
wxListLineData *line1 = *((wxListLineData**)arg1); wxListLineData *line1 = *((wxListLineData**)arg1);
wxListLineData *line2 = *((wxListLineData**)arg2); wxListLineData *line2 = *((wxListLineData**)arg2);
wxListItem item; wxListItem item;
line1->GetItem( 0, item ); line1->GetItem( 0, item );
long data1 = item.m_data; long data1 = item.m_data;
line2->GetItem( 0, item ); line2->GetItem( 0, item );
long data2 = item.m_data; long data2 = item.m_data;
return list_ctrl_compare_func_2( data1, data2, list_ctrl_compare_data ); return list_ctrl_compare_func_2( data1, data2, list_ctrl_compare_data );
} }
void wxListMainWindow::SortItems( wxListCtrlCompare fn, long data ) void wxListMainWindow::SortItems( wxListCtrlCompare fn, long data )
{ {
list_ctrl_compare_func_2 = fn; list_ctrl_compare_func_2 = fn;
list_ctrl_compare_data = data; list_ctrl_compare_data = data;
m_lines.Sort( list_ctrl_compare_func_1 ); m_lines.Sort( list_ctrl_compare_func_1 );
} }
// ------------------------------------------------------------------------------------- // -------------------------------------------------------------------------------------
@@ -2251,13 +2256,13 @@ IMPLEMENT_DYNAMIC_CLASS(wxListEvent, wxNotifyEvent)
wxListEvent::wxListEvent( wxEventType commandType, int id ): wxListEvent::wxListEvent( wxEventType commandType, int id ):
wxNotifyEvent( commandType, id ) wxNotifyEvent( commandType, id )
{ {
m_code = 0; m_code = 0;
m_itemIndex = 0; m_itemIndex = 0;
m_oldItemIndex = 0; m_oldItemIndex = 0;
m_col = 0; m_col = 0;
m_cancelled = FALSE; m_cancelled = FALSE;
m_pointDrag.x = 0; m_pointDrag.x = 0;
m_pointDrag.y = 0; m_pointDrag.y = 0;
} }
// ------------------------------------------------------------------------------------- // -------------------------------------------------------------------------------------
@@ -2273,11 +2278,11 @@ END_EVENT_TABLE()
wxListCtrl::wxListCtrl(void) wxListCtrl::wxListCtrl(void)
{ {
m_imageListNormal = (wxImageList *) NULL; m_imageListNormal = (wxImageList *) NULL;
m_imageListSmall = (wxImageList *) NULL; m_imageListSmall = (wxImageList *) NULL;
m_imageListState = (wxImageList *) NULL; m_imageListState = (wxImageList *) NULL;
m_mainWin = (wxListMainWindow*) NULL; m_mainWin = (wxListMainWindow*) NULL;
m_headerWin = (wxListHeaderWindow*) NULL; m_headerWin = (wxListHeaderWindow*) NULL;
} }
wxListCtrl::~wxListCtrl(void) wxListCtrl::~wxListCtrl(void)
@@ -2289,124 +2294,126 @@ bool wxListCtrl::Create( wxWindow *parent, wxWindowID id,
long style, const wxValidator &validator, long style, const wxValidator &validator,
const wxString &name ) const wxString &name )
{ {
m_imageListNormal = (wxImageList *) NULL; m_imageListNormal = (wxImageList *) NULL;
m_imageListSmall = (wxImageList *) NULL; m_imageListSmall = (wxImageList *) NULL;
m_imageListState = (wxImageList *) NULL; m_imageListState = (wxImageList *) NULL;
m_mainWin = (wxListMainWindow*) NULL; m_mainWin = (wxListMainWindow*) NULL;
m_headerWin = (wxListHeaderWindow*) NULL; m_headerWin = (wxListHeaderWindow*) NULL;
long s = style; long s = style;
if ((s & wxLC_REPORT == 0) && if ((s & wxLC_REPORT == 0) &&
(s & wxLC_LIST == 0) && (s & wxLC_LIST == 0) &&
(s & wxLC_ICON == 0)) (s & wxLC_ICON == 0))
s = s | wxLC_LIST; {
s = s | wxLC_LIST;
}
bool ret = wxControl::Create( parent, id, pos, size, s, name ); bool ret = wxControl::Create( parent, id, pos, size, s, name );
SetValidator( validator ); SetValidator( validator );
if (s & wxSUNKEN_BORDER) s -= wxSUNKEN_BORDER; if (s & wxSUNKEN_BORDER) s -= wxSUNKEN_BORDER;
m_mainWin = new wxListMainWindow( this, -1, wxPoint(0,0), size, s ); m_mainWin = new wxListMainWindow( this, -1, wxPoint(0,0), size, s );
if (GetWindowStyleFlag() & wxLC_REPORT) if (GetWindowStyleFlag() & wxLC_REPORT)
m_headerWin = new wxListHeaderWindow( this, -1, m_mainWin, wxPoint(0,0), wxSize(size.x,23), wxTAB_TRAVERSAL ); m_headerWin = new wxListHeaderWindow( this, -1, m_mainWin, wxPoint(0,0), wxSize(size.x,23), wxTAB_TRAVERSAL );
else else
m_headerWin = (wxListHeaderWindow *) NULL; m_headerWin = (wxListHeaderWindow *) NULL;
return ret; return ret;
} }
void wxListCtrl::OnSize( wxSizeEvent &WXUNUSED(event) ) void wxListCtrl::OnSize( wxSizeEvent &WXUNUSED(event) )
{ {
// handled in OnIdle /* handled in OnIdle */
if (m_mainWin) m_mainWin->m_dirty = TRUE; if (m_mainWin) m_mainWin->m_dirty = TRUE;
} }
void wxListCtrl::SetSingleStyle( long style, bool add ) void wxListCtrl::SetSingleStyle( long style, bool add )
{ {
long flag = GetWindowStyleFlag(); long flag = GetWindowStyleFlag();
if (add) if (add)
{ {
if (style & wxLC_MASK_TYPE) flag = flag & ~wxLC_MASK_TYPE; if (style & wxLC_MASK_TYPE) flag = flag & ~wxLC_MASK_TYPE;
if (style & wxLC_MASK_ALIGN) flag = flag & ~wxLC_MASK_ALIGN; if (style & wxLC_MASK_ALIGN) flag = flag & ~wxLC_MASK_ALIGN;
if (style & wxLC_MASK_SORT) flag = flag & ~wxLC_MASK_SORT; if (style & wxLC_MASK_SORT) flag = flag & ~wxLC_MASK_SORT;
} }
if (add) if (add)
{ {
flag |= style; flag |= style;
} }
else else
{ {
if (flag & style) flag -= style; if (flag & style) flag -= style;
} }
SetWindowStyleFlag( flag ); SetWindowStyleFlag( flag );
} }
void wxListCtrl::SetWindowStyleFlag( long flag ) void wxListCtrl::SetWindowStyleFlag( long flag )
{ {
m_mainWin->DeleteEverything(); m_mainWin->DeleteEverything();
int width = 0; int width = 0;
int height = 0; int height = 0;
GetClientSize( &width, &height ); GetClientSize( &width, &height );
m_mainWin->SetMode( flag ); m_mainWin->SetMode( flag );
if (flag & wxLC_REPORT) if (flag & wxLC_REPORT)
{
if (!(GetWindowStyleFlag() & wxLC_REPORT))
{ {
// m_mainWin->SetSize( 0, 24, width, height-24 ); if (!(GetWindowStyleFlag() & wxLC_REPORT))
if (!m_headerWin) {
{ // m_mainWin->SetSize( 0, 24, width, height-24 );
m_headerWin = new wxListHeaderWindow( this, -1, m_mainWin, wxPoint(0,0), wxSize(width,23), wxTAB_TRAVERSAL ); if (!m_headerWin)
} {
else m_headerWin = new wxListHeaderWindow( this, -1, m_mainWin, wxPoint(0,0), wxSize(width,23), wxTAB_TRAVERSAL );
{ }
// m_headerWin->SetSize( 0, 0, width, 23 ); else
m_headerWin->Show( TRUE ); {
} // m_headerWin->SetSize( 0, 0, width, 23 );
m_headerWin->Show( TRUE );
}
}
} }
} else
else
{
if (GetWindowStyleFlag() & wxLC_REPORT)
{ {
// m_mainWin->SetSize( 0, 0, width, height ); if (GetWindowStyleFlag() & wxLC_REPORT)
m_headerWin->Show( FALSE ); {
// m_mainWin->SetSize( 0, 0, width, height );
m_headerWin->Show( FALSE );
}
} }
}
wxWindow::SetWindowStyleFlag( flag ); wxWindow::SetWindowStyleFlag( flag );
} }
bool wxListCtrl::GetColumn(int col, wxListItem &item) const bool wxListCtrl::GetColumn(int col, wxListItem &item) const
{ {
m_mainWin->GetColumn( col, item ); m_mainWin->GetColumn( col, item );
return TRUE; return TRUE;
} }
bool wxListCtrl::SetColumn( int col, wxListItem& item ) bool wxListCtrl::SetColumn( int col, wxListItem& item )
{ {
m_mainWin->SetColumn( col, item ); m_mainWin->SetColumn( col, item );
return TRUE; return TRUE;
} }
int wxListCtrl::GetColumnWidth( int col ) const int wxListCtrl::GetColumnWidth( int col ) const
{ {
return m_mainWin->GetColumnWidth( col ); return m_mainWin->GetColumnWidth( col );
} }
bool wxListCtrl::SetColumnWidth( int col, int width ) bool wxListCtrl::SetColumnWidth( int col, int width )
{ {
m_mainWin->SetColumnWidth( col, width ); m_mainWin->SetColumnWidth( col, width );
return TRUE; return TRUE;
} }
int wxListCtrl::GetCountPerPage(void) const int wxListCtrl::GetCountPerPage(void) const
@@ -2422,129 +2429,128 @@ wxText& wxListCtrl::GetEditControl(void) const
bool wxListCtrl::GetItem( wxListItem &info ) const bool wxListCtrl::GetItem( wxListItem &info ) const
{ {
m_mainWin->GetItem( info ); m_mainWin->GetItem( info );
return TRUE; return TRUE;
} }
bool wxListCtrl::SetItem( wxListItem &info ) bool wxListCtrl::SetItem( wxListItem &info )
{ {
m_mainWin->SetItem( info ); m_mainWin->SetItem( info );
return TRUE; return TRUE;
} }
long wxListCtrl::SetItem( long index, int col, const wxString& label, int imageId ) long wxListCtrl::SetItem( long index, int col, const wxString& label, int imageId )
{ {
wxListItem info; wxListItem info;
info.m_text = label; info.m_text = label;
info.m_mask = wxLIST_MASK_TEXT; info.m_mask = wxLIST_MASK_TEXT;
info.m_itemId = index; info.m_itemId = index;
info.m_col = col; info.m_col = col;
if ( imageId > -1 ) if ( imageId > -1 )
{ {
info.m_image = imageId; info.m_image = imageId;
info.m_mask |= wxLIST_MASK_IMAGE; info.m_mask |= wxLIST_MASK_IMAGE;
} };
; m_mainWin->SetItem(info);
m_mainWin->SetItem(info); return TRUE;
return TRUE;
} }
int wxListCtrl::GetItemState( long item, long stateMask ) const int wxListCtrl::GetItemState( long item, long stateMask ) const
{ {
return m_mainWin->GetItemState( item, stateMask ); return m_mainWin->GetItemState( item, stateMask );
} }
bool wxListCtrl::SetItemState( long item, long state, long stateMask ) bool wxListCtrl::SetItemState( long item, long state, long stateMask )
{ {
m_mainWin->SetItemState( item, state, stateMask ); m_mainWin->SetItemState( item, state, stateMask );
return TRUE; return TRUE;
} }
bool wxListCtrl::SetItemImage( long item, int image, int WXUNUSED(selImage) ) bool wxListCtrl::SetItemImage( long item, int image, int WXUNUSED(selImage) )
{ {
wxListItem info; wxListItem info;
info.m_image = image; info.m_image = image;
info.m_mask = wxLIST_MASK_IMAGE; info.m_mask = wxLIST_MASK_IMAGE;
info.m_itemId = item; info.m_itemId = item;
m_mainWin->SetItem( info ); m_mainWin->SetItem( info );
return TRUE; return TRUE;
} }
wxString wxListCtrl::GetItemText( long item ) const wxString wxListCtrl::GetItemText( long item ) const
{ {
wxListItem info; wxListItem info;
info.m_itemId = item; info.m_itemId = item;
m_mainWin->GetItem( info ); m_mainWin->GetItem( info );
return info.m_text; return info.m_text;
} }
void wxListCtrl::SetItemText( long item, const wxString &str ) void wxListCtrl::SetItemText( long item, const wxString &str )
{ {
wxListItem info; wxListItem info;
info.m_mask = wxLIST_MASK_TEXT; info.m_mask = wxLIST_MASK_TEXT;
info.m_itemId = item; info.m_itemId = item;
info.m_text = str; info.m_text = str;
m_mainWin->SetItem( info ); m_mainWin->SetItem( info );
} }
long wxListCtrl::GetItemData( long item ) const long wxListCtrl::GetItemData( long item ) const
{ {
wxListItem info; wxListItem info;
info.m_itemId = item; info.m_itemId = item;
m_mainWin->GetItem( info ); m_mainWin->GetItem( info );
return info.m_data; return info.m_data;
} }
bool wxListCtrl::SetItemData( long item, long data ) bool wxListCtrl::SetItemData( long item, long data )
{ {
wxListItem info; wxListItem info;
info.m_mask = wxLIST_MASK_DATA; info.m_mask = wxLIST_MASK_DATA;
info.m_itemId = item; info.m_itemId = item;
info.m_data = data; info.m_data = data;
m_mainWin->SetItem( info ); m_mainWin->SetItem( info );
return TRUE; return TRUE;
} }
bool wxListCtrl::GetItemRect( long item, wxRectangle &rect, int WXUNUSED(code) ) const bool wxListCtrl::GetItemRect( long item, wxRectangle &rect, int WXUNUSED(code) ) const
{ {
m_mainWin->GetItemRect( item, rect ); m_mainWin->GetItemRect( item, rect );
return TRUE; return TRUE;
} }
bool wxListCtrl::GetItemPosition( long item, wxPoint& pos ) const bool wxListCtrl::GetItemPosition( long item, wxPoint& pos ) const
{ {
m_mainWin->GetItemPosition( item, pos ); m_mainWin->GetItemPosition( item, pos );
return TRUE; return TRUE;
} }
bool wxListCtrl::SetItemPosition( long WXUNUSED(item), const wxPoint& WXUNUSED(pos) ) bool wxListCtrl::SetItemPosition( long WXUNUSED(item), const wxPoint& WXUNUSED(pos) )
{ {
return 0; return 0;
} }
int wxListCtrl::GetItemCount(void) const int wxListCtrl::GetItemCount(void) const
{ {
return m_mainWin->GetItemCount(); return m_mainWin->GetItemCount();
} }
int wxListCtrl::GetColumnCount(void) const int wxListCtrl::GetColumnCount(void) const
{ {
return m_mainWin->GetColumnCount(); return m_mainWin->GetColumnCount();
} }
void wxListCtrl::SetItemSpacing( int spacing, bool isSmall ) void wxListCtrl::SetItemSpacing( int spacing, bool isSmall )
{ {
m_mainWin->SetItemSpacing( spacing, isSmall ); m_mainWin->SetItemSpacing( spacing, isSmall );
} }
int wxListCtrl::GetItemSpacing( bool isSmall ) const int wxListCtrl::GetItemSpacing( bool isSmall ) const
{ {
return m_mainWin->GetItemSpacing( isSmall ); return m_mainWin->GetItemSpacing( isSmall );
} }
int wxListCtrl::GetSelectedItemCount(void) const int wxListCtrl::GetSelectedItemCount(void) const
{ {
return m_mainWin->GetSelectedItemCount(); return m_mainWin->GetSelectedItemCount();
} }
/* /*
@@ -2559,51 +2565,51 @@ void wxListCtrl::SetTextColour(const wxColour& WXUNUSED(col))
long wxListCtrl::GetTopItem(void) const long wxListCtrl::GetTopItem(void) const
{ {
return 0; return 0;
} }
long wxListCtrl::GetNextItem( long item, int geom, int state ) const long wxListCtrl::GetNextItem( long item, int geom, int state ) const
{ {
return m_mainWin->GetNextItem( item, geom, state ); return m_mainWin->GetNextItem( item, geom, state );
} }
wxImageList *wxListCtrl::GetImageList(int which) const wxImageList *wxListCtrl::GetImageList(int which) const
{ {
if (which == wxIMAGE_LIST_NORMAL) if (which == wxIMAGE_LIST_NORMAL)
{ {
return m_imageListNormal; return m_imageListNormal;
} }
else if (which == wxIMAGE_LIST_SMALL) else if (which == wxIMAGE_LIST_SMALL)
{ {
return m_imageListSmall; return m_imageListSmall;
} }
else if (which == wxIMAGE_LIST_STATE) else if (which == wxIMAGE_LIST_STATE)
{ {
return m_imageListState; return m_imageListState;
} }
return (wxImageList *) NULL; return (wxImageList *) NULL;
} }
void wxListCtrl::SetImageList( wxImageList *imageList, int which ) void wxListCtrl::SetImageList( wxImageList *imageList, int which )
{ {
m_mainWin->SetImageList( imageList, which ); m_mainWin->SetImageList( imageList, which );
} }
bool wxListCtrl::Arrange( int WXUNUSED(flag) ) bool wxListCtrl::Arrange( int WXUNUSED(flag) )
{ {
return 0; return 0;
} }
bool wxListCtrl::DeleteItem( long item ) bool wxListCtrl::DeleteItem( long item )
{ {
m_mainWin->DeleteItem( item ); m_mainWin->DeleteItem( item );
return TRUE; return TRUE;
} }
bool wxListCtrl::DeleteAllItems(void) bool wxListCtrl::DeleteAllItems(void)
{ {
m_mainWin->DeleteAllItems(); m_mainWin->DeleteAllItems();
return TRUE; return TRUE;
} }
bool wxListCtrl::DeleteAllColumns() bool wxListCtrl::DeleteAllColumns()
@@ -2611,18 +2617,18 @@ bool wxListCtrl::DeleteAllColumns()
for ( size_t n = 0; n < m_mainWin->m_columns.GetCount(); n++ ) for ( size_t n = 0; n < m_mainWin->m_columns.GetCount(); n++ )
DeleteColumn(n); DeleteColumn(n);
return TRUE; return TRUE;
} }
void wxListCtrl::ClearAll() void wxListCtrl::ClearAll()
{ {
m_mainWin->DeleteEverything(); m_mainWin->DeleteEverything();
} }
bool wxListCtrl::DeleteColumn( int col ) bool wxListCtrl::DeleteColumn( int col )
{ {
m_mainWin->DeleteColumn( col ); m_mainWin->DeleteColumn( col );
return TRUE; return TRUE;
} }
/* /*
@@ -2633,35 +2639,35 @@ wxText& wxListCtrl::Edit( long WXUNUSED(item ) )
bool wxListCtrl::EnsureVisible( long item ) bool wxListCtrl::EnsureVisible( long item )
{ {
m_mainWin->EnsureVisible( item ); m_mainWin->EnsureVisible( item );
return TRUE; return TRUE;
} }
long wxListCtrl::FindItem( long start, const wxString& str, bool partial ) long wxListCtrl::FindItem( long start, const wxString& str, bool partial )
{ {
return m_mainWin->FindItem( start, str, partial ); return m_mainWin->FindItem( start, str, partial );
} }
long wxListCtrl::FindItem( long start, long data ) long wxListCtrl::FindItem( long start, long data )
{ {
return m_mainWin->FindItem( start, data ); return m_mainWin->FindItem( start, data );
} }
long wxListCtrl::FindItem( long WXUNUSED(start), const wxPoint& WXUNUSED(pt), long wxListCtrl::FindItem( long WXUNUSED(start), const wxPoint& WXUNUSED(pt),
int WXUNUSED(direction)) int WXUNUSED(direction))
{ {
return 0; return 0;
} }
long wxListCtrl::HitTest( const wxPoint &point, int &flags ) long wxListCtrl::HitTest( const wxPoint &point, int &flags )
{ {
return m_mainWin->HitTest( (int)point.x, (int)point.y, flags ); return m_mainWin->HitTest( (int)point.x, (int)point.y, flags );
} }
long wxListCtrl::InsertItem( wxListItem& info ) long wxListCtrl::InsertItem( wxListItem& info )
{ {
m_mainWin->InsertItem( info ); m_mainWin->InsertItem( info );
return 0; return 0;
} }
long wxListCtrl::InsertItem( long index, const wxString &label ) long wxListCtrl::InsertItem( long index, const wxString &label )

View File

@@ -542,7 +542,7 @@ void wxFrame::SetMenuBar( wxMenuBar *menuBar )
} }
} }
if (m_sizeSet) GtkOnSize( m_x, m_y, m_width, m_height ); m_sizeSet = FALSE;
} }
wxMenuBar *wxFrame::GetMenuBar() const wxMenuBar *wxFrame::GetMenuBar() const
@@ -560,7 +560,7 @@ wxToolBar* wxFrame::CreateToolBar(long style, wxWindowID id, const wxString& nam
GetChildren().DeleteObject( m_frameToolBar ); GetChildren().DeleteObject( m_frameToolBar );
if (m_sizeSet) GtkOnSize( m_x, m_y, m_width, m_height ); m_sizeSet = FALSE;
return m_frameToolBar; return m_frameToolBar;
} }
@@ -583,7 +583,7 @@ wxStatusBar* wxFrame::CreateStatusBar( int number, long style, wxWindowID id, co
m_frameStatusBar = OnCreateStatusBar( number, style, id, name ); m_frameStatusBar = OnCreateStatusBar( number, style, id, name );
if (m_sizeSet) GtkOnSize( m_x, m_y, m_width, m_height ); m_sizeSet = FALSE;
return m_frameStatusBar; return m_frameStatusBar;
} }

View File

@@ -72,8 +72,25 @@ gtk_listbox_button_press_callback( GtkWidget *widget, GdkEventButton *gdk_event,
{ {
wxCommandEvent event( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, listbox->GetId() ); wxCommandEvent event( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, listbox->GetId() );
event.SetEventObject( listbox ); event.SetEventObject( listbox );
event.SetInt( sel );
wxArrayInt aSelections;
int count = listbox->GetSelections(aSelections);
if ( count > 0 )
{
event.m_commandInt = aSelections[0] ;
event.m_clientData = listbox->GetClientData( event.m_commandInt );
wxString str(listbox->GetString(event.m_commandInt));
if (str != "") event.m_commandString = copystring((char *)(const char *)str);
}
else
{
event.m_commandInt = -1 ;
event.m_commandString = copystring("") ;
}
listbox->GetEventHandler()->ProcessEvent( event ); listbox->GetEventHandler()->ProcessEvent( event );
if (event.m_commandString) delete[] event.m_commandString ;
} }
return FALSE; return FALSE;

View File

@@ -1231,6 +1231,11 @@ static void wxInsertChildInWindow( wxWindow* parent, wxWindow* child )
gtk_widget_set_usize( GTK_WIDGET(child->m_widget), gtk_widget_set_usize( GTK_WIDGET(child->m_widget),
child->m_width, child->m_width,
child->m_height ); child->m_height );
if (wxIS_KIND_OF(parent,wxFrame))
{
parent->m_sizeSet = FALSE;
}
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------

View File

@@ -542,7 +542,7 @@ void wxFrame::SetMenuBar( wxMenuBar *menuBar )
} }
} }
if (m_sizeSet) GtkOnSize( m_x, m_y, m_width, m_height ); m_sizeSet = FALSE;
} }
wxMenuBar *wxFrame::GetMenuBar() const wxMenuBar *wxFrame::GetMenuBar() const
@@ -560,7 +560,7 @@ wxToolBar* wxFrame::CreateToolBar(long style, wxWindowID id, const wxString& nam
GetChildren().DeleteObject( m_frameToolBar ); GetChildren().DeleteObject( m_frameToolBar );
if (m_sizeSet) GtkOnSize( m_x, m_y, m_width, m_height ); m_sizeSet = FALSE;
return m_frameToolBar; return m_frameToolBar;
} }
@@ -583,7 +583,7 @@ wxStatusBar* wxFrame::CreateStatusBar( int number, long style, wxWindowID id, co
m_frameStatusBar = OnCreateStatusBar( number, style, id, name ); m_frameStatusBar = OnCreateStatusBar( number, style, id, name );
if (m_sizeSet) GtkOnSize( m_x, m_y, m_width, m_height ); m_sizeSet = FALSE;
return m_frameStatusBar; return m_frameStatusBar;
} }

View File

@@ -72,8 +72,25 @@ gtk_listbox_button_press_callback( GtkWidget *widget, GdkEventButton *gdk_event,
{ {
wxCommandEvent event( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, listbox->GetId() ); wxCommandEvent event( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, listbox->GetId() );
event.SetEventObject( listbox ); event.SetEventObject( listbox );
event.SetInt( sel );
wxArrayInt aSelections;
int count = listbox->GetSelections(aSelections);
if ( count > 0 )
{
event.m_commandInt = aSelections[0] ;
event.m_clientData = listbox->GetClientData( event.m_commandInt );
wxString str(listbox->GetString(event.m_commandInt));
if (str != "") event.m_commandString = copystring((char *)(const char *)str);
}
else
{
event.m_commandInt = -1 ;
event.m_commandString = copystring("") ;
}
listbox->GetEventHandler()->ProcessEvent( event ); listbox->GetEventHandler()->ProcessEvent( event );
if (event.m_commandString) delete[] event.m_commandString ;
} }
return FALSE; return FALSE;

View File

@@ -1231,6 +1231,11 @@ static void wxInsertChildInWindow( wxWindow* parent, wxWindow* child )
gtk_widget_set_usize( GTK_WIDGET(child->m_widget), gtk_widget_set_usize( GTK_WIDGET(child->m_widget),
child->m_width, child->m_width,
child->m_height ); child->m_height );
if (wxIS_KIND_OF(parent,wxFrame))
{
parent->m_sizeSet = FALSE;
}
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------

View File

@@ -122,7 +122,7 @@ getinitfile(char* buf, int size)
int i, j; int i, j;
char* ptr; char* ptr;
j = STRLEN("/iodbc.ini") + 1; j = STRLEN("/odbc.ini") + 1;
if( size < j ) if( size < j )
{ {
@@ -130,7 +130,7 @@ getinitfile(char* buf, int size)
} }
#ifdef FIX_INI_FILE #ifdef FIX_INI_FILE
sprintf( buf, "%s/iodbc.ini", DIR_INI_FILE ); sprintf( buf, "%s/odbc.ini", DIR_INI_FILE );
#else #else
# ifdef OS2 # ifdef OS2
*buf = '\0'; *buf = '\0';
@@ -151,7 +151,7 @@ getinitfile(char* buf, int size)
} }
else else
{ {
strcpy( buf, "iodbc.ini" ); strcpy( buf, "odbc.ini" );
} }
} }
@@ -166,7 +166,7 @@ getinitfile(char* buf, int size)
return NULL; return NULL;
} }
sprintf( buf + i, "/iodbc.ini"); sprintf( buf + i, "/odbc.ini");
return buf; return buf;
# else # else
@@ -189,7 +189,7 @@ getinitfile(char* buf, int size)
return NULL; return NULL;
} }
sprintf( buf, "%s%s", ptr, "/.iodbc.ini"); sprintf( buf, "%s%s", ptr, "/.odbc.ini");
/* i.e. searching ~/.iodbc.ini */ /* i.e. searching ~/.iodbc.ini */
# endif # endif
# endif # endif

View File

@@ -323,7 +323,7 @@ bool wxResourceManager::ShowResourceEditor(bool show, wxWindow *WXUNUSED(parent)
c->bottom.SameAs (m_editorFrame, wxBottom, 0); c->bottom.SameAs (m_editorFrame, wxBottom, 0);
c->width.Unconstrained(); c->width.Unconstrained();
#if defined(__WXGTK__) || defined(__WXMOTIF__) #if defined(__WXGTK__) || defined(__WXMOTIF__)
c->height.Absolute(105); c->height.Absolute(120);
#else #else
c->height.Absolute(60); c->height.Absolute(60);
#endif #endif

View File

@@ -1,10 +1,10 @@
Summary: The GTK+ 1.0 port of wxWindows library Summary: The GTK+ 1.0 port of wxWindows library
Name: wxGTK Name: wxGTK
Version: 2b1 Version: 2.0 beta 2
Release: 1 Release: 1
Copyright: LGPL Copyright: LGPL
Group: X11/Libraries Group: X11/Libraries
Source0: ftp://wesley.informatik.uni-freiburg.de/pub/linux/wxxt/source/wxGTK2b1.tgz Source0: ftp://wesley.informatik.uni-freiburg.de/pub/linux/wxxt/source
URL: http://www.freiburg.linux.de/~wxxt/docs.html URL: http://www.freiburg.linux.de/~wxxt/docs.html
Packager: Michael Kiefte <mkiefte@gpu.srv.ualberta.ca> Packager: Michael Kiefte <mkiefte@gpu.srv.ualberta.ca>
Requires: gtk+ >= 1.0.4 Requires: gtk+ >= 1.0.4
@@ -29,11 +29,11 @@ make install
/sbin/ldconfig /sbin/ldconfig
%files %files
%doc COPYING.LIB INSTALL.txt LICENCE.txt README.txt SYMBOLS.txt TODO.txt %doc docs/gtk/COPYING.LIB docs/gtk/install.txt docs/gtk/licence.txt docs/gtk/readme.txt docs/symbols.txt docs/gtk/todo.txt
/usr/include/wx /usr/include/wx
/usr/lib/wx /usr/lib/wx
/usr/lib/libwx_gtk_1_0.a /usr/lib/libwx_gtk2.a
/usr/lib/libwx_gtk_1_0.so /usr/lib/libwx_gtk2.so
/usr/lib/libwx_gtk_1_0.so.1 /usr/lib/libwx_gtk2.so.0
/usr/lib/libwx_gtk_1_0.so.1.99 /usr/lib/libwx_gtk2.so.0.1
/usr/bin/wx-config /usr/bin/wx-config