From 5b077d483bcd47bcd1c3e89a9adc1d6b1a44e046 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Thu, 21 Jan 1999 19:02:18 +0000 Subject: [PATCH] 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 --- include/wx/expr.h | 36 +- include/wx/gtk/dnd.h | 1 + include/wx/gtk1/dnd.h | 1 + samples/controls/controls.cpp | 63 ++-- samples/db/dbtest.cpp | 41 +-- samples/db/listdb.cpp | 2 +- samples/db/listdb.h | 2 +- samples/dnd/dnd.cpp | 6 +- src/Makefile.in | 1 - src/common/cwy_tab.c | 18 +- src/common/dbtable.cpp | 12 +- src/common/dosyacc.c | 18 +- src/common/parser.y | 18 +- src/common/wxexpr.cpp | 12 +- src/generic/listctrl.cpp | 590 ++++++++++++++++---------------- src/gtk/frame.cpp | 6 +- src/gtk/listbox.cpp | 19 +- src/gtk/window.cpp | 5 + src/gtk1/frame.cpp | 6 +- src/gtk1/listbox.cpp | 19 +- src/gtk1/window.cpp | 5 + src/iodbc/misc.c | 10 +- utils/dialoged/src/reseditr.cpp | 2 +- wxGTK.spec | 14 +- 24 files changed, 482 insertions(+), 425 deletions(-) diff --git a/include/wx/expr.h b/include/wx/expr.h index 0ea70c6d85..7dee180b93 100644 --- a/include/wx/expr.h +++ b/include/wx/expr.h @@ -88,12 +88,12 @@ #ifdef __cplusplus extern "C" { char *proio_cons(char *, char *); -char * make_integer(char *); -char * make_word(char *); -char * make_string(char *); -char * make_real(char *, char *); -char * make_exp(char *, char *); -char * make_exp2(char *, char *, char*); +char * wxmake_integer(char *); +char * wxmake_word(char *); +char * wxmake_string(char *); +char * wxmake_real(char *, char *); +char * wxmake_exp(char *, char *); +char * wxmake_exp2(char *, char *, char*); void add_expr(char *); void process_command(char *); void syntax_error(char *); @@ -101,23 +101,23 @@ void syntax_error(char *); #else #if __BORLANDC__ char *proio_cons(char *, char *); -char * make_integer(char *); -char * make_word(char *); -char * make_string(char *); -char * make_real(char *, char *); -char * make_exp(char *, char *); -char * make_exp2(char *, char *, char*); +char * wxmake_integer(char *); +char * wxmake_word(char *); +char * wxmake_string(char *); +char * wxmake_real(char *, char *); +char * wxmake_exp(char *, char *); +char * wxmake_exp2(char *, char *, char*); void add_expr(char *); void process_command(char *); void syntax_error(char *); #else char *proio_cons(); -char * make_integer(); -char * make_word(); -char * make_string(); -char * make_real(); -char * make_exp(); -char * make_exp2(); +char * wxmake_integer(); +char * wxmake_word(); +char * wxmake_string(); +char * wxmake_real(); +char * wxmake_exp(); +char * wxmake_exp2(); void add_expr(); void process_command(); diff --git a/include/wx/gtk/dnd.h b/include/wx/gtk/dnd.h index 998f656c59..f2f81e8550 100644 --- a/include/wx/gtk/dnd.h +++ b/include/wx/gtk/dnd.h @@ -60,6 +60,7 @@ class wxDropTarget: public wxObject virtual void OnEnter() { } 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; // Override these to indicate what kind of data you support: diff --git a/include/wx/gtk1/dnd.h b/include/wx/gtk1/dnd.h index 998f656c59..f2f81e8550 100644 --- a/include/wx/gtk1/dnd.h +++ b/include/wx/gtk1/dnd.h @@ -60,6 +60,7 @@ class wxDropTarget: public wxObject virtual void OnEnter() { } 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; // Override these to indicate what kind of data you support: diff --git a/samples/controls/controls.cpp b/samples/controls/controls.cpp index 4e2621c15c..1053d0653c 100644 --- a/samples/controls/controls.cpp +++ b/samples/controls/controls.cpp @@ -62,6 +62,7 @@ class MyPanel: public wxPanel void OnSize( wxSizeEvent& event ); void OnListBox( wxCommandEvent &event ); + void OnListBoxDoubleClick( wxCommandEvent &event ); void OnListBoxButtons( wxCommandEvent &event ); void OnChoice( wxCommandEvent &event ); void OnChoiceButtons( wxCommandEvent &event ); @@ -209,6 +210,7 @@ BEGIN_EVENT_TABLE(MyPanel, wxPanel) EVT_SIZE ( MyPanel::OnSize) EVT_NOTEBOOK_PAGE_CHANGED(ID_NOTEBOOK, MyPanel::OnPageChanged) 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_STR, 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 ) : 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->SetBackgroundColour("wheat"); +// m_text->SetBackgroundColour("wheat"); 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; - m_notebook->SetBackgroundColour("cadet blue"); +// m_notebook->SetBackgroundColour("cadet blue"); wxPanel *panel = (wxPanel*) NULL; panel = new wxPanel(m_notebook); - panel->SetBackgroundColour("cadet blue"); - panel->SetForegroundColour("blue"); +// panel->SetBackgroundColour("cadet blue"); +// panel->SetForegroundColour("blue"); 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_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_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) ); 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->SetValue(FALSE); m_notebook->AddPage(panel, "wxList", FALSE, Image_List); panel = new wxPanel(m_notebook); - panel->SetBackgroundColour("cadet blue"); - panel->SetForegroundColour("blue"); +// panel->SetBackgroundColour("cadet blue"); +// panel->SetForegroundColour("blue"); 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_STR, "Select 'This'", wxPoint(340,30), 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); panel = new wxPanel(m_notebook); - panel->SetBackgroundColour("cadet blue"); - panel->SetForegroundColour("blue"); +// panel->SetBackgroundColour("cadet blue"); +// panel->SetForegroundColour("blue"); 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_STR, "Select 'This'", wxPoint(340,30), 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); panel = new wxPanel(m_notebook); - panel->SetBackgroundColour("cadet blue"); - panel->SetForegroundColour("blue"); +// panel->SetBackgroundColour("cadet blue"); +// panel->SetForegroundColour("blue"); wxTextCtrl *tc = new wxTextCtrl( panel, ID_TEXT, "Write text here.", wxPoint(10,10), wxSize(320,28)); (*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) << " More text."; 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->SetBackgroundColour("cadet blue"); - panel->SetForegroundColour("blue"); +// panel->SetBackgroundColour("cadet 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->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->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_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->SetForegroundColour("blue"); +// m_fontButton->SetForegroundColour("blue"); (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) ); 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); panel = new wxPanel(m_notebook); - panel->SetBackgroundColour("cadet blue"); - panel->SetForegroundColour("blue"); +// panel->SetBackgroundColour("cadet blue"); +// panel->SetForegroundColour("blue"); (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->SetBackgroundColour("wheat"); +// m_gauge->SetBackgroundColour("wheat"); 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 wxStaticText( panel, -1, "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 ); 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->SetBackgroundColour("wheat"); +// m_spinbutton->SetBackgroundColour("wheat"); m_spinbutton->SetRange(0,100); m_notebook->AddPage(panel, "wxGauge", FALSE, Image_Gauge); @@ -531,6 +533,13 @@ void MyPanel::OnListBox( wxCommandEvent &event ) 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 ) { switch (event.GetId()) diff --git a/samples/db/dbtest.cpp b/samples/db/dbtest.cpp index fb6d2dc30d..466dfaf428 100644 --- a/samples/db/dbtest.cpp +++ b/samples/db/dbtest.cpp @@ -41,23 +41,22 @@ #include "db.xpm" #endif -#include // Included strictly for reading the text file with the database parameters +#include /* Included strictly for reading the text file with the database parameters */ -#include // Required in the file which will get the data source connection -#include // Has the wxTable object from which all data objects will inherit their data table functionality +#include /* Required in the file which will get the data source connection */ +#include /* 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 "listdb.h" // Code to support the "Lookup" button on the editor dialog +#include "dbtest.h" /* Header file for this demonstration program */ +#include "listdb.h" /* Code to support the "Lookup" button on the editor dialog */ 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_Selection2[]; // Used to return the second column value for the selected line from the listDB routines - -DatabaseDemoFrame *DemoFrame; // Pointer to the main frame +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 */ +DatabaseDemoFrame *DemoFrame; /* Pointer to the main frame */ /* Pointer to the main database connection used in the program. This * 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 * new wxDB object be created and used for it. */ + wxDB *READONLY_DB; - /* * This function will return the exact string(s) from the database engine * 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 * should be copied for long term use */ + char *GetExtendedDBErrorMsg(char *ErrFile, int ErrLine) { static wxString msg; @@ -102,9 +102,7 @@ char *GetExtendedDBErrorMsg(char *ErrFile, int ErrLine) if (ErrFile || ErrLine) { - msg += "\n"; - msg.Append ('-',80); - msg += "\nFile: "; + msg += "File: "; msg += ErrFile; msg += " Line: "; tStr.Printf("%d",ErrLine); @@ -112,12 +110,11 @@ char *GetExtendedDBErrorMsg(char *ErrFile, int ErrLine) msg += "\n"; } - msg.Append ('-',80); - msg.Append ("\nODBC ERRORS\n"); - msg.Append ('-',80); + msg.Append ("\nODBC errors:\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) { // Skip over any free connections @@ -544,8 +541,8 @@ CeditorDlg::CeditorDlg(wxWindow *parent) : wxPanel (parent, 1, 1, 460, 455) // Build the dialog - wxStaticBox *FunctionGrp = 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_FN_GROUP, "", wxPoint(15, 1), wxSize(497, 69), 0, "FunctionGrp"); + (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"); 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" // 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 Contact->where = (char*) (const char*) Contact->whereStr; diff --git a/samples/db/listdb.cpp b/samples/db/listdb.cpp index bea0ddc717..574bab36be 100644 --- a/samples/db/listdb.cpp +++ b/samples/db/listdb.cpp @@ -75,7 +75,7 @@ char ListDB_Selection[LOOKUP_COL_LEN+1]; char ListDB_Selection2[LOOKUP_COL_LEN+1]; // Constants -const LISTDB_NO_SPACES_BETWEEN_COLS = 3; +const int LISTDB_NO_SPACES_BETWEEN_COLS = 3; // Clookup constructor diff --git a/samples/db/listdb.h b/samples/db/listdb.h index f3aa8f24f6..440ad92f3b 100644 --- a/samples/db/listdb.h +++ b/samples/db/listdb.h @@ -23,7 +23,7 @@ #include -const LOOKUP_COL_LEN = 250; +const int LOOKUP_COL_LEN = 250; // Global database connection extern wxDB *READONLY_DB; diff --git a/samples/dnd/dnd.cpp b/samples/dnd/dnd.cpp index 7c66964f3e..8525390533 100644 --- a/samples/dnd/dnd.cpp +++ b/samples/dnd/dnd.cpp @@ -145,7 +145,7 @@ DnDFrame::DnDFrame(wxFrame *frame, char *title, int x, int y, int w, int h) m_strText("wxWindows drag & drop works :-)") { - SetBackgroundColour(* wxWHITE); +// SetBackgroundColour(* wxWHITE); // frame icon and status bar 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, wxTE_MULTILINE | wxTE_READONLY | - wxSUNKEN_BORDER| wxHSCROLL); + wxSUNKEN_BORDER ); // redirect log messages to the text window (don't forget to delete it!) m_pLog = new wxLogTextCtrl(m_ctrlLog); @@ -237,7 +237,7 @@ void DnDFrame::OnPaint(wxPaintEvent& /*event*/) wxPaintDC dc(this); 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 */) diff --git a/src/Makefile.in b/src/Makefile.in index 8c6214edd4..bfd94286f9 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -158,7 +158,6 @@ install:: $(INSTALL) -d $(libdir)/wx/include/wx/gtk ; \ mv $(includedir)/wx/gtk/setup.h $(libdir)/wx/include/wx/gtk/setup.h ; \ fi - @echo " Moving setup.h to library path" @if test "@TOOLKIT@" = "MOTIF" ; then \ cd $(WXBASEDIR)/src ; \ $(INSTALL) -d $(libdir)/wx/include/wx/motif ; \ diff --git a/src/common/cwy_tab.c b/src/common/cwy_tab.c index 15d0360865..050f96167f 100644 --- a/src/common/cwy_tab.c +++ b/src/common/cwy_tab.c @@ -397,7 +397,7 @@ yyreduce: { case 3: #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; case 4: #line 70 "parser.y" @@ -409,7 +409,7 @@ case 5: break; case 6: #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; case 7: #line 78 "parser.y" @@ -433,7 +433,7 @@ case 11: break; case 12: #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); } break; case 13: @@ -442,27 +442,27 @@ case 13: break; case 14: #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; case 15: #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; case 16: #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; case 17: #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; case 18: #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; case 19: #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); } break; case 20: diff --git a/src/common/dbtable.cpp b/src/common/dbtable.cpp index bf5c843771..d1166229c4 100644 --- a/src/common/dbtable.cpp +++ b/src/common/dbtable.cpp @@ -508,9 +508,9 @@ UWORD wxTable::GetRowNum(void) /********** wxTable::bindInsertParams() **********/ bool wxTable::bindInsertParams(void) { - SWORD fSqlType; - UDWORD precision; - SWORD scale; + SWORD fSqlType = 0; + UDWORD precision = 0; + SWORD scale = 0; // Bind each column (that can be inserted) of the table to a parameter marker for (int i = 0; i < noCols; i++) @@ -563,9 +563,9 @@ bool wxTable::bindInsertParams(void) /********** wxTable::bindUpdateParams() **********/ bool wxTable::bindUpdateParams(void) { - SWORD fSqlType; - UDWORD precision; - SWORD scale; + SWORD fSqlType = 0; + UDWORD precision = 0; + SWORD scale = 0; // Bind each UPDATEABLE column of the table to a parameter marker for (int i = 0, colNo = 1; i < noCols; i++) diff --git a/src/common/dosyacc.c b/src/common/dosyacc.c index a5e44c0cc2..269cea2073 100644 --- a/src/common/dosyacc.c +++ b/src/common/dosyacc.c @@ -393,7 +393,7 @@ yyreduce: { case 3: #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; case 4: #line 70 "parser.y" @@ -405,7 +405,7 @@ case 5: break; case 6: #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; case 7: #line 78 "parser.y" @@ -429,7 +429,7 @@ case 11: break; case 12: #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); } break; case 13: @@ -438,27 +438,27 @@ case 13: break; case 14: #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; case 15: #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; case 16: #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; case 17: #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; case 18: #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; case 19: #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); } break; case 20: diff --git a/src/common/parser.y b/src/common/parser.y index 16b9b2c33f..d9ae9b194b 100644 --- a/src/common/parser.y +++ b/src/common/parser.y @@ -73,7 +73,7 @@ commands : /* empty */ ; 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 {process_command($1);} | error PERIOD @@ -81,7 +81,7 @@ command : WORD PERIOD ; 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 {$$ = proio_cons(NULL, NULL);} | OPEN_SQUARE arglist CLOSE_SQUARE @@ -98,24 +98,24 @@ arglist : ; 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); } | arg1 {$$ = $1; } arg1 : WORD - {$$ = make_word($1); free($1);} + {$$ = wxmake_word($1); free($1);} | STRING - {$$ = make_string($1); free($1);} + {$$ = wxmake_string($1); free($1);} | INTEGER - {$$ = make_integer($1); free($1);} + {$$ = wxmake_integer($1); free($1);} | INTEGER PERIOD INTEGER - {$$ = make_real($1, $3); free($1); free($3); } + {$$ = wxmake_real($1, $3); free($1); free($3); } | INTEGER EXP INTEGER - {$$ = make_exp($1, $3); free($1); free($3); } + {$$ = wxmake_exp($1, $3); free($1); free($3); } | 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); } | expr diff --git a/src/common/wxexpr.cpp b/src/common/wxexpr.cpp index 39687462f1..5a3ace2c14 100644 --- a/src/common/wxexpr.cpp +++ b/src/common/wxexpr.cpp @@ -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)); return (char *)x; } -char *make_real(char *str1, char *str2) +char *wxmake_real(char *str1, char *str2) { char buf[50]; @@ -1158,7 +1158,7 @@ char *make_real(char *str1, char *str2) // 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 exponent = (double)atoi(str2); @@ -1170,7 +1170,7 @@ char *make_exp(char *str1, char *str2) return (char *)x; } -char *make_exp2(char *str1, char *str2, char *str3) +char *wxmake_exp2(char *str1, char *str2, char *str3) { char buf[50]; @@ -1185,13 +1185,13 @@ char *make_exp2(char *str1, char *str2, char *str3) return (char *)x; } -char *make_word(char *str) +char *wxmake_word(char *str) { wxExpr *x = new wxExpr(wxExprWord, str); return (char *)x; } -char *make_string(char *str) +char *wxmake_string(char *str) { char *s, *t; int len, i; diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index 8927a2d981..5e198b6dac 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -2049,155 +2049,160 @@ void wxListMainWindow::DeleteItem( long index ) 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" ); - m_dirty = TRUE; - wxNode *node = m_columns.Nth( col ); - if (node) m_columns.DeleteNode( node ); + m_dirty = TRUE; + wxNode *node = m_columns.Nth( col ); + if (node) m_columns.DeleteNode( node ); } void wxListMainWindow::DeleteAllItems( void ) { - m_dirty = TRUE; - m_current = (wxListLineData *) NULL; - wxNode *node = m_lines.First(); - while (node) - { - wxListLineData *line = (wxListLineData*)node->Data(); - DeleteLine( line ); - node = node->Next(); - } - m_lines.Clear(); + m_dirty = TRUE; + m_current = (wxListLineData *) NULL; + wxNode *node = m_lines.First(); + while (node) + { + wxListLineData *line = (wxListLineData*)node->Data(); + DeleteLine( line ); + node = node->Next(); + } + m_lines.Clear(); } void wxListMainWindow::DeleteEverything( void ) { - m_dirty = TRUE; - m_current = (wxListLineData *) NULL; - wxNode *node = m_lines.First(); - while (node) - { - wxListLineData *line = (wxListLineData*)node->Data(); - DeleteLine( line ); - node = node->Next(); - } - m_lines.Clear(); - m_current = (wxListLineData *) NULL; - m_columns.Clear(); + m_dirty = TRUE; + m_current = (wxListLineData *) NULL; + wxNode *node = m_lines.First(); + while (node) + { + wxListLineData *line = (wxListLineData*)node->Data(); + DeleteLine( line ); + node = node->Next(); + } + m_lines.Clear(); + m_current = (wxListLineData *) NULL; + m_columns.Clear(); } void wxListMainWindow::EnsureVisible( long index ) { - wxListLineData *oldCurrent = m_current; - m_current = (wxListLineData *) NULL; - int i = index; - wxNode *node = m_lines.Nth( i ); - if (node) m_current = (wxListLineData*)node->Data(); - if (m_current) MoveToFocus(); - m_current = oldCurrent; + wxListLineData *oldCurrent = m_current; + m_current = (wxListLineData *) NULL; + int i = index; + wxNode *node = m_lines.Nth( i ); + if (node) m_current = (wxListLineData*)node->Data(); + if (m_current) MoveToFocus(); + m_current = oldCurrent; } long wxListMainWindow::FindItem(long start, const wxString& str, bool WXUNUSED(partial) ) { - long pos = start; - wxString tmp = str; - if (pos < 0) pos = 0; - wxNode *node = m_lines.Nth( pos ); - while (node) - { - wxListLineData *line = (wxListLineData*)node->Data(); - wxString s = ""; - line->GetText( 0, s ); - if (s == tmp) return pos; - node = node->Next(); - pos++; - } - return -1; + long pos = start; + wxString tmp = str; + if (pos < 0) pos = 0; + wxNode *node = m_lines.Nth( pos ); + while (node) + { + wxListLineData *line = (wxListLineData*)node->Data(); + wxString s = ""; + line->GetText( 0, s ); + if (s == tmp) return pos; + node = node->Next(); + pos++; + } + return -1; } long wxListMainWindow::FindItem(long start, long data) { - long pos = start; - if (pos < 0) pos = 0; - wxNode *node = m_lines.Nth( pos ); - while (node) - { - wxListLineData *line = (wxListLineData*)node->Data(); - wxListItem item; - line->GetItem( 0, item ); - if (item.m_data == data) return pos; - node = node->Next(); - pos++; - } - return -1; + long pos = start; + if (pos < 0) pos = 0; + wxNode *node = m_lines.Nth( pos ); + while (node) + { + wxListLineData *line = (wxListLineData*)node->Data(); + wxListItem item; + line->GetItem( 0, item ); + if (item.m_data == data) return pos; + node = node->Next(); + pos++; + } + return -1; } long wxListMainWindow::HitTest( int x, int y, int &flags ) { - wxNode *node = m_lines.First(); - int count = 0; - while (node) - { - wxListLineData *line = (wxListLineData*)node->Data(); - long ret = line->IsHit( x, y ); - if (ret & flags) + wxNode *node = m_lines.First(); + int count = 0; + while (node) { - flags = ret; - return count; + wxListLineData *line = (wxListLineData*)node->Data(); + long ret = line->IsHit( x, y ); + if (ret & flags) + { + flags = ret; + return count; + } + node = node->Next(); + count++; } - node = node->Next(); - count++; - } - return -1; + return -1; } void wxListMainWindow::InsertItem( wxListItem &item ) { - m_dirty = TRUE; - int mode = 0; - if (m_mode & wxLC_REPORT) mode = wxLC_REPORT; - else if (m_mode & wxLC_LIST) mode = wxLC_LIST; - else if (m_mode & wxLC_ICON) mode = wxLC_ICON; - 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) - { - line->InitItems( GetColumnCount() ); - item.m_width = GetColumnWidth( 0 )-3; - } - else - line->InitItems( 1 ); - line->SetItem( 0, item ); - if ((item.m_itemId >= 0) && (item.m_itemId < (int)m_lines.GetCount())) - { - wxNode *node = m_lines.Nth( item.m_itemId ); - if (node) m_lines.Insert( node, line ); - } - else - { - m_lines.Append( line ); - } + m_dirty = TRUE; + int mode = 0; + if (m_mode & wxLC_REPORT) mode = wxLC_REPORT; + else if (m_mode & wxLC_LIST) mode = wxLC_LIST; + else if (m_mode & wxLC_ICON) mode = wxLC_ICON; + 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) + { + line->InitItems( GetColumnCount() ); + item.m_width = GetColumnWidth( 0 )-3; + } + else + { + line->InitItems( 1 ); + } + + line->SetItem( 0, item ); + if ((item.m_itemId >= 0) && (item.m_itemId < (int)m_lines.GetCount())) + { + 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 ) { - m_dirty = TRUE; - 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 (node) - m_columns.Insert( node, column ); - } - else + m_dirty = TRUE; + if (m_mode & wxLC_REPORT) { - m_columns.Append( column ); + 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 (node) + m_columns.Insert( node, column ); + } + else + { + m_columns.Append( column ); + } } - } } 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 ) { - wxListLineData *line1 = *((wxListLineData**)arg1); - wxListLineData *line2 = *((wxListLineData**)arg2); - wxListItem item; - line1->GetItem( 0, item ); - long data1 = item.m_data; - line2->GetItem( 0, item ); - long data2 = item.m_data; - return list_ctrl_compare_func_2( data1, data2, list_ctrl_compare_data ); + wxListLineData *line1 = *((wxListLineData**)arg1); + wxListLineData *line2 = *((wxListLineData**)arg2); + wxListItem item; + line1->GetItem( 0, item ); + long data1 = item.m_data; + line2->GetItem( 0, item ); + long data2 = item.m_data; + return list_ctrl_compare_func_2( data1, data2, list_ctrl_compare_data ); } void wxListMainWindow::SortItems( wxListCtrlCompare fn, long data ) { - list_ctrl_compare_func_2 = fn; - list_ctrl_compare_data = data; - m_lines.Sort( list_ctrl_compare_func_1 ); + list_ctrl_compare_func_2 = fn; + list_ctrl_compare_data = data; + m_lines.Sort( list_ctrl_compare_func_1 ); } // ------------------------------------------------------------------------------------- @@ -2251,13 +2256,13 @@ IMPLEMENT_DYNAMIC_CLASS(wxListEvent, wxNotifyEvent) wxListEvent::wxListEvent( wxEventType commandType, int id ): wxNotifyEvent( commandType, id ) { - m_code = 0; - m_itemIndex = 0; - m_oldItemIndex = 0; - m_col = 0; - m_cancelled = FALSE; - m_pointDrag.x = 0; - m_pointDrag.y = 0; + m_code = 0; + m_itemIndex = 0; + m_oldItemIndex = 0; + m_col = 0; + m_cancelled = FALSE; + m_pointDrag.x = 0; + m_pointDrag.y = 0; } // ------------------------------------------------------------------------------------- @@ -2273,11 +2278,11 @@ END_EVENT_TABLE() wxListCtrl::wxListCtrl(void) { - m_imageListNormal = (wxImageList *) NULL; - m_imageListSmall = (wxImageList *) NULL; - m_imageListState = (wxImageList *) NULL; - m_mainWin = (wxListMainWindow*) NULL; - m_headerWin = (wxListHeaderWindow*) NULL; + m_imageListNormal = (wxImageList *) NULL; + m_imageListSmall = (wxImageList *) NULL; + m_imageListState = (wxImageList *) NULL; + m_mainWin = (wxListMainWindow*) NULL; + m_headerWin = (wxListHeaderWindow*) NULL; } wxListCtrl::~wxListCtrl(void) @@ -2289,124 +2294,126 @@ bool wxListCtrl::Create( wxWindow *parent, wxWindowID id, long style, const wxValidator &validator, const wxString &name ) { - m_imageListNormal = (wxImageList *) NULL; - m_imageListSmall = (wxImageList *) NULL; - m_imageListState = (wxImageList *) NULL; - m_mainWin = (wxListMainWindow*) NULL; - m_headerWin = (wxListHeaderWindow*) NULL; + m_imageListNormal = (wxImageList *) NULL; + m_imageListSmall = (wxImageList *) NULL; + m_imageListState = (wxImageList *) NULL; + m_mainWin = (wxListMainWindow*) NULL; + m_headerWin = (wxListHeaderWindow*) NULL; - long s = style; + long s = style; - if ((s & wxLC_REPORT == 0) && - (s & wxLC_LIST == 0) && - (s & wxLC_ICON == 0)) - s = s | wxLC_LIST; + if ((s & wxLC_REPORT == 0) && + (s & wxLC_LIST == 0) && + (s & wxLC_ICON == 0)) + { + 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) - m_headerWin = new wxListHeaderWindow( this, -1, m_mainWin, wxPoint(0,0), wxSize(size.x,23), wxTAB_TRAVERSAL ); - else - m_headerWin = (wxListHeaderWindow *) NULL; + if (GetWindowStyleFlag() & wxLC_REPORT) + m_headerWin = new wxListHeaderWindow( this, -1, m_mainWin, wxPoint(0,0), wxSize(size.x,23), wxTAB_TRAVERSAL ); + else + m_headerWin = (wxListHeaderWindow *) NULL; - return ret; + return ret; } 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 ) { - long flag = GetWindowStyleFlag(); + long flag = GetWindowStyleFlag(); - if (add) - { - if (style & wxLC_MASK_TYPE) flag = flag & ~wxLC_MASK_TYPE; - if (style & wxLC_MASK_ALIGN) flag = flag & ~wxLC_MASK_ALIGN; - if (style & wxLC_MASK_SORT) flag = flag & ~wxLC_MASK_SORT; - } + if (add) + { + if (style & wxLC_MASK_TYPE) flag = flag & ~wxLC_MASK_TYPE; + if (style & wxLC_MASK_ALIGN) flag = flag & ~wxLC_MASK_ALIGN; + if (style & wxLC_MASK_SORT) flag = flag & ~wxLC_MASK_SORT; + } - if (add) - { - flag |= style; - } - else - { - if (flag & style) flag -= style; - } + if (add) + { + flag |= style; + } + else + { + if (flag & style) flag -= style; + } - SetWindowStyleFlag( flag ); + SetWindowStyleFlag( flag ); } void wxListCtrl::SetWindowStyleFlag( long flag ) { - m_mainWin->DeleteEverything(); + m_mainWin->DeleteEverything(); - int width = 0; - int height = 0; - GetClientSize( &width, &height ); + int width = 0; + int height = 0; + GetClientSize( &width, &height ); - m_mainWin->SetMode( flag ); + m_mainWin->SetMode( flag ); - if (flag & wxLC_REPORT) - { - if (!(GetWindowStyleFlag() & wxLC_REPORT)) + if (flag & wxLC_REPORT) { -// m_mainWin->SetSize( 0, 24, width, height-24 ); - if (!m_headerWin) - { - m_headerWin = new wxListHeaderWindow( this, -1, m_mainWin, wxPoint(0,0), wxSize(width,23), wxTAB_TRAVERSAL ); - } - else - { -// m_headerWin->SetSize( 0, 0, width, 23 ); - m_headerWin->Show( TRUE ); - } + if (!(GetWindowStyleFlag() & wxLC_REPORT)) + { +// m_mainWin->SetSize( 0, 24, width, height-24 ); + if (!m_headerWin) + { + m_headerWin = new wxListHeaderWindow( this, -1, m_mainWin, wxPoint(0,0), wxSize(width,23), wxTAB_TRAVERSAL ); + } + else + { +// m_headerWin->SetSize( 0, 0, width, 23 ); + m_headerWin->Show( TRUE ); + } + } } - } - else - { - if (GetWindowStyleFlag() & wxLC_REPORT) + else { -// m_mainWin->SetSize( 0, 0, width, height ); - m_headerWin->Show( FALSE ); + if (GetWindowStyleFlag() & wxLC_REPORT) + { +// 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 { - m_mainWin->GetColumn( col, item ); - return TRUE; + m_mainWin->GetColumn( col, item ); + return TRUE; } bool wxListCtrl::SetColumn( int col, wxListItem& item ) { - m_mainWin->SetColumn( col, item ); - return TRUE; + m_mainWin->SetColumn( col, item ); + return TRUE; } int wxListCtrl::GetColumnWidth( int col ) const { - return m_mainWin->GetColumnWidth( col ); + return m_mainWin->GetColumnWidth( col ); } bool wxListCtrl::SetColumnWidth( int col, int width ) { - m_mainWin->SetColumnWidth( col, width ); - return TRUE; + m_mainWin->SetColumnWidth( col, width ); + return TRUE; } int wxListCtrl::GetCountPerPage(void) const @@ -2422,129 +2429,128 @@ wxText& wxListCtrl::GetEditControl(void) const bool wxListCtrl::GetItem( wxListItem &info ) const { - m_mainWin->GetItem( info ); - return TRUE; + m_mainWin->GetItem( info ); + return TRUE; } bool wxListCtrl::SetItem( wxListItem &info ) { - m_mainWin->SetItem( info ); - return TRUE; + m_mainWin->SetItem( info ); + return TRUE; } long wxListCtrl::SetItem( long index, int col, const wxString& label, int imageId ) { - wxListItem info; - info.m_text = label; - info.m_mask = wxLIST_MASK_TEXT; - info.m_itemId = index; - info.m_col = col; - if ( imageId > -1 ) - { - info.m_image = imageId; - info.m_mask |= wxLIST_MASK_IMAGE; - } -; - m_mainWin->SetItem(info); - return TRUE; + wxListItem info; + info.m_text = label; + info.m_mask = wxLIST_MASK_TEXT; + info.m_itemId = index; + info.m_col = col; + if ( imageId > -1 ) + { + info.m_image = imageId; + info.m_mask |= wxLIST_MASK_IMAGE; + }; + m_mainWin->SetItem(info); + return TRUE; } 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 ) { - m_mainWin->SetItemState( item, state, stateMask ); - return TRUE; + m_mainWin->SetItemState( item, state, stateMask ); + return TRUE; } bool wxListCtrl::SetItemImage( long item, int image, int WXUNUSED(selImage) ) { - wxListItem info; - info.m_image = image; - info.m_mask = wxLIST_MASK_IMAGE; - info.m_itemId = item; - m_mainWin->SetItem( info ); - return TRUE; + wxListItem info; + info.m_image = image; + info.m_mask = wxLIST_MASK_IMAGE; + info.m_itemId = item; + m_mainWin->SetItem( info ); + return TRUE; } wxString wxListCtrl::GetItemText( long item ) const { - wxListItem info; - info.m_itemId = item; - m_mainWin->GetItem( info ); - return info.m_text; + wxListItem info; + info.m_itemId = item; + m_mainWin->GetItem( info ); + return info.m_text; } void wxListCtrl::SetItemText( long item, const wxString &str ) { - wxListItem info; - info.m_mask = wxLIST_MASK_TEXT; - info.m_itemId = item; - info.m_text = str; - m_mainWin->SetItem( info ); + wxListItem info; + info.m_mask = wxLIST_MASK_TEXT; + info.m_itemId = item; + info.m_text = str; + m_mainWin->SetItem( info ); } long wxListCtrl::GetItemData( long item ) const { - wxListItem info; - info.m_itemId = item; - m_mainWin->GetItem( info ); - return info.m_data; + wxListItem info; + info.m_itemId = item; + m_mainWin->GetItem( info ); + return info.m_data; } bool wxListCtrl::SetItemData( long item, long data ) { - wxListItem info; - info.m_mask = wxLIST_MASK_DATA; - info.m_itemId = item; - info.m_data = data; - m_mainWin->SetItem( info ); - return TRUE; + wxListItem info; + info.m_mask = wxLIST_MASK_DATA; + info.m_itemId = item; + info.m_data = data; + m_mainWin->SetItem( info ); + return TRUE; } bool wxListCtrl::GetItemRect( long item, wxRectangle &rect, int WXUNUSED(code) ) const { - m_mainWin->GetItemRect( item, rect ); - return TRUE; + m_mainWin->GetItemRect( item, rect ); + return TRUE; } bool wxListCtrl::GetItemPosition( long item, wxPoint& pos ) const { - m_mainWin->GetItemPosition( item, pos ); - return TRUE; + m_mainWin->GetItemPosition( item, pos ); + return TRUE; } bool wxListCtrl::SetItemPosition( long WXUNUSED(item), const wxPoint& WXUNUSED(pos) ) { - return 0; + return 0; } int wxListCtrl::GetItemCount(void) const { - return m_mainWin->GetItemCount(); + return m_mainWin->GetItemCount(); } int wxListCtrl::GetColumnCount(void) const { - return m_mainWin->GetColumnCount(); + return m_mainWin->GetColumnCount(); } void wxListCtrl::SetItemSpacing( int spacing, bool isSmall ) { - m_mainWin->SetItemSpacing( spacing, isSmall ); + m_mainWin->SetItemSpacing( spacing, isSmall ); } int wxListCtrl::GetItemSpacing( bool isSmall ) const { - return m_mainWin->GetItemSpacing( isSmall ); + return m_mainWin->GetItemSpacing( isSmall ); } 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 { - return 0; + return 0; } 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 { - if (which == wxIMAGE_LIST_NORMAL) - { - return m_imageListNormal; - } - else if (which == wxIMAGE_LIST_SMALL) - { - return m_imageListSmall; - } - else if (which == wxIMAGE_LIST_STATE) - { - return m_imageListState; - } - return (wxImageList *) NULL; + if (which == wxIMAGE_LIST_NORMAL) + { + return m_imageListNormal; + } + else if (which == wxIMAGE_LIST_SMALL) + { + return m_imageListSmall; + } + else if (which == wxIMAGE_LIST_STATE) + { + return m_imageListState; + } + return (wxImageList *) NULL; } void wxListCtrl::SetImageList( wxImageList *imageList, int which ) { - m_mainWin->SetImageList( imageList, which ); + m_mainWin->SetImageList( imageList, which ); } bool wxListCtrl::Arrange( int WXUNUSED(flag) ) { - return 0; + return 0; } bool wxListCtrl::DeleteItem( long item ) { - m_mainWin->DeleteItem( item ); - return TRUE; + m_mainWin->DeleteItem( item ); + return TRUE; } bool wxListCtrl::DeleteAllItems(void) { - m_mainWin->DeleteAllItems(); - return TRUE; + m_mainWin->DeleteAllItems(); + return TRUE; } bool wxListCtrl::DeleteAllColumns() @@ -2611,18 +2617,18 @@ bool wxListCtrl::DeleteAllColumns() for ( size_t n = 0; n < m_mainWin->m_columns.GetCount(); n++ ) DeleteColumn(n); - return TRUE; + return TRUE; } void wxListCtrl::ClearAll() { - m_mainWin->DeleteEverything(); + m_mainWin->DeleteEverything(); } bool wxListCtrl::DeleteColumn( int col ) { - m_mainWin->DeleteColumn( col ); - return TRUE; + m_mainWin->DeleteColumn( col ); + return TRUE; } /* @@ -2633,35 +2639,35 @@ wxText& wxListCtrl::Edit( long WXUNUSED(item ) ) bool wxListCtrl::EnsureVisible( long item ) { - m_mainWin->EnsureVisible( item ); - return TRUE; + m_mainWin->EnsureVisible( item ); + return TRUE; } 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 ) { - return m_mainWin->FindItem( start, data ); + return m_mainWin->FindItem( start, data ); } long wxListCtrl::FindItem( long WXUNUSED(start), const wxPoint& WXUNUSED(pt), int WXUNUSED(direction)) { - return 0; + return 0; } 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 ) { - m_mainWin->InsertItem( info ); - return 0; + m_mainWin->InsertItem( info ); + return 0; } long wxListCtrl::InsertItem( long index, const wxString &label ) diff --git a/src/gtk/frame.cpp b/src/gtk/frame.cpp index 993bbbf75b..934ea9d990 100644 --- a/src/gtk/frame.cpp +++ b/src/gtk/frame.cpp @@ -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 @@ -560,7 +560,7 @@ wxToolBar* wxFrame::CreateToolBar(long style, wxWindowID id, const wxString& nam GetChildren().DeleteObject( m_frameToolBar ); - if (m_sizeSet) GtkOnSize( m_x, m_y, m_width, m_height ); + m_sizeSet = FALSE; return m_frameToolBar; } @@ -583,7 +583,7 @@ wxStatusBar* wxFrame::CreateStatusBar( int number, long style, wxWindowID id, co 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; } diff --git a/src/gtk/listbox.cpp b/src/gtk/listbox.cpp index 0fef727841..32cf66671e 100644 --- a/src/gtk/listbox.cpp +++ b/src/gtk/listbox.cpp @@ -72,8 +72,25 @@ gtk_listbox_button_press_callback( GtkWidget *widget, GdkEventButton *gdk_event, { wxCommandEvent event( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, listbox->GetId() ); 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 ); + + if (event.m_commandString) delete[] event.m_commandString ; } return FALSE; diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index 51302a0530..5a527820d6 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -1231,6 +1231,11 @@ static void wxInsertChildInWindow( wxWindow* parent, wxWindow* child ) gtk_widget_set_usize( GTK_WIDGET(child->m_widget), child->m_width, child->m_height ); + + if (wxIS_KIND_OF(parent,wxFrame)) + { + parent->m_sizeSet = FALSE; + } } //----------------------------------------------------------------------------- diff --git a/src/gtk1/frame.cpp b/src/gtk1/frame.cpp index 993bbbf75b..934ea9d990 100644 --- a/src/gtk1/frame.cpp +++ b/src/gtk1/frame.cpp @@ -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 @@ -560,7 +560,7 @@ wxToolBar* wxFrame::CreateToolBar(long style, wxWindowID id, const wxString& nam GetChildren().DeleteObject( m_frameToolBar ); - if (m_sizeSet) GtkOnSize( m_x, m_y, m_width, m_height ); + m_sizeSet = FALSE; return m_frameToolBar; } @@ -583,7 +583,7 @@ wxStatusBar* wxFrame::CreateStatusBar( int number, long style, wxWindowID id, co 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; } diff --git a/src/gtk1/listbox.cpp b/src/gtk1/listbox.cpp index 0fef727841..32cf66671e 100644 --- a/src/gtk1/listbox.cpp +++ b/src/gtk1/listbox.cpp @@ -72,8 +72,25 @@ gtk_listbox_button_press_callback( GtkWidget *widget, GdkEventButton *gdk_event, { wxCommandEvent event( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, listbox->GetId() ); 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 ); + + if (event.m_commandString) delete[] event.m_commandString ; } return FALSE; diff --git a/src/gtk1/window.cpp b/src/gtk1/window.cpp index 51302a0530..5a527820d6 100644 --- a/src/gtk1/window.cpp +++ b/src/gtk1/window.cpp @@ -1231,6 +1231,11 @@ static void wxInsertChildInWindow( wxWindow* parent, wxWindow* child ) gtk_widget_set_usize( GTK_WIDGET(child->m_widget), child->m_width, child->m_height ); + + if (wxIS_KIND_OF(parent,wxFrame)) + { + parent->m_sizeSet = FALSE; + } } //----------------------------------------------------------------------------- diff --git a/src/iodbc/misc.c b/src/iodbc/misc.c index 42b26a62b9..713467766f 100644 --- a/src/iodbc/misc.c +++ b/src/iodbc/misc.c @@ -122,7 +122,7 @@ getinitfile(char* buf, int size) int i, j; char* ptr; - j = STRLEN("/iodbc.ini") + 1; + j = STRLEN("/odbc.ini") + 1; if( size < j ) { @@ -130,7 +130,7 @@ getinitfile(char* buf, int size) } #ifdef FIX_INI_FILE - sprintf( buf, "%s/iodbc.ini", DIR_INI_FILE ); + sprintf( buf, "%s/odbc.ini", DIR_INI_FILE ); #else # ifdef OS2 *buf = '\0'; @@ -151,7 +151,7 @@ getinitfile(char* buf, int size) } else { - strcpy( buf, "iodbc.ini" ); + strcpy( buf, "odbc.ini" ); } } @@ -166,7 +166,7 @@ getinitfile(char* buf, int size) return NULL; } - sprintf( buf + i, "/iodbc.ini"); + sprintf( buf + i, "/odbc.ini"); return buf; # else @@ -189,7 +189,7 @@ getinitfile(char* buf, int size) return NULL; } - sprintf( buf, "%s%s", ptr, "/.iodbc.ini"); + sprintf( buf, "%s%s", ptr, "/.odbc.ini"); /* i.e. searching ~/.iodbc.ini */ # endif # endif diff --git a/utils/dialoged/src/reseditr.cpp b/utils/dialoged/src/reseditr.cpp index a5f3709768..27a2d41cfc 100644 --- a/utils/dialoged/src/reseditr.cpp +++ b/utils/dialoged/src/reseditr.cpp @@ -323,7 +323,7 @@ bool wxResourceManager::ShowResourceEditor(bool show, wxWindow *WXUNUSED(parent) c->bottom.SameAs (m_editorFrame, wxBottom, 0); c->width.Unconstrained(); #if defined(__WXGTK__) || defined(__WXMOTIF__) - c->height.Absolute(105); + c->height.Absolute(120); #else c->height.Absolute(60); #endif diff --git a/wxGTK.spec b/wxGTK.spec index b93582a23e..51d22c0df5 100644 --- a/wxGTK.spec +++ b/wxGTK.spec @@ -1,10 +1,10 @@ Summary: The GTK+ 1.0 port of wxWindows library Name: wxGTK -Version: 2b1 +Version: 2.0 beta 2 Release: 1 Copyright: LGPL 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 Packager: Michael Kiefte Requires: gtk+ >= 1.0.4 @@ -29,11 +29,11 @@ make install /sbin/ldconfig %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/lib/wx -/usr/lib/libwx_gtk_1_0.a -/usr/lib/libwx_gtk_1_0.so -/usr/lib/libwx_gtk_1_0.so.1 -/usr/lib/libwx_gtk_1_0.so.1.99 +/usr/lib/libwx_gtk2.a +/usr/lib/libwx_gtk2.so +/usr/lib/libwx_gtk2.so.0 +/usr/lib/libwx_gtk2.so.0.1 /usr/bin/wx-config -- 2.47.2