Hi, I recently updated to the latest version 2.8.4.1 and the wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED event seems to be broken. Before the update to 2.8.4.1, when I received a wxNotebookEvent object from a wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED event, a call to event:GetSelection() returned the correct value for the newly selected page, but in 2.8.4.1 it returns an out-of-range value that seems to always be in the range of 150-300 (I have under 10 pages in my notebook). I suspect it's because the GetSelection() called on the wxNotebookEvent object is inherited from wxCommandEvent and the wxCommandEvent's GetSelection has another meaning than the wxNotebookEvent's GetSelection(), because I uncommented the wxBookCtrlBaseEvent's GetSelection() (which wxNotebookEvent inherits of) and it fixed the problem (I uncommented line 441 in windows.i, "int GetSelection() const" in the declaration of %class wxBookCtrlBaseEvent). Now I fixed it in my own build but it would be nice to fix it in the main distrib. My build: wxMSW-2.8.4 + wxLua-2.8.4.1 static, no debug, no unicode all compiled using mingw on windows xp sp2 (anyway I doubt it's system- specific, but i'll let someone who knows better judge of that)
Thank you very much! Committed to CVS. I wrote the bit in bindings.wx.lua to find overridden C++ functions to get rid of unnecessary duplicates, but I forgot to check to make sure that the functions were virtual. I don't remember there being too many of them, so hopefully there won't be more problems. Thanks, John Labenski On 7/28/07, FC <frc...@ho...> wrote: > Hi, > > I recently updated to the latest version 2.8.4.1 and the > wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED event seems to be broken. > > Before the update to 2.8.4.1, when I received a wxNotebookEvent object from a > wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED event, a call to event:GetSelection() > returned the correct value for the newly selected page, but in 2.8.4.1 it > returns an out-of-range value that seems to always be in the range of 150-300 > (I have under 10 pages in my notebook). > > I suspect it's because the GetSelection() called on the wxNotebookEvent object > is inherited from wxCommandEvent and the wxCommandEvent's GetSelection has > another meaning than the wxNotebookEvent's GetSelection(), because I > uncommented the wxBookCtrlBaseEvent's GetSelection() (which wxNotebookEvent > inherits of) and it fixed the problem (I uncommented line 441 in > windows.i, "int GetSelection() const" in the declaration of %class > wxBookCtrlBaseEvent). > > Now I fixed it in my own build but it would be nice to fix it in the main > distrib. > > My build: > wxMSW-2.8.4 + wxLua-2.8.4.1 static, no debug, no unicode > all compiled using mingw on windows xp sp2 (anyway I doubt it's system- > specific, but i'll let someone who knows better judge of that) > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > wxlua-users mailing list > wxl...@li... > https://lists.sourceforge.net/lists/listinfo/wxlua-users >
Hi all! I am very new in wxLUA, I find it in LUA-A-I-O. I made a little = application which contains a ListCtrl: tListBoxes["lst_reghubs"] =3D = wx.wxListView(tPanels.p3,tListBoxes.wxID_LST_REGHUBS,wx.wxPoint(8,8), = wx.wxSize(383,383),wx.wxLC_REPORT + wx.wxLC_SINGLE_SEL + wx.wxLC_HRULES = = + wx.wxLC_VRULES) tListBoxes["lst_reghubs"]:InsertColumn(0, "Hub address", = wx.wxLIST_FORMAT_LEFT, -1) -- Primary key tListBoxes["lst_reghubs"]:InsertColumn(1, "Hub name", = wx.wxLIST_FORMAT_LEFT, -1) tListBoxes["lst_reghubs"]:InsertColumn(2, "Hub description", = wx.wxLIST_FORMAT_LEFT, -1) tListBoxes["lst_reghubs"]:InsertColumn(3, "Hub users", = wx.wxLIST_FORMAT_LEFT, -1) tListBoxes["lst_reghubs"]:InsertColumn(4, "Hub share", = wx.wxLIST_FORMAT_LEFT, -1) tListBoxes["lst_reghubs"]:InsertColumn(5, "Hub nation", = wx.wxLIST_FORMAT_LEFT, -1) tListBoxes["lst_reghubs"]:InsertColumn(6, "Hub last registration", = wx.wxLIST_FORMAT_LEFT, -1) tListBoxes["lst_reghubs"]:SetColumnWidth(0, 80) tListBoxes["lst_reghubs"]:SetColumnWidth(1, 80) tListBoxes["lst_reghubs"]:SetColumnWidth(2, 80) tListBoxes["lst_reghubs"]:SetColumnWidth(3, 55) tListBoxes["lst_reghubs"]:SetColumnWidth(4, 55) tListBoxes["lst_reghubs"]:SetColumnWidth(5, 55) tListBoxes["lst_reghubs"]:SetColumnWidth(6, 80) tListBoxes["lst_reghubs"]:SetBackgroundColour(tColours.wxListViewColour)= tListBoxes["lst_reghubs"]:SetTextColour(wx.wxWHITE) It appears as it must be: 7 columns with grids. I want to search on each= = lines when something will be written into a textbox, so search through t= he = added lines. for i =3D 0,tListBoxes["lst_reghubs"]:GetItemCount() - 1 do local thishub =3D tListBoxes["lst_reghubs"]:GetItemText(i) -- ... Something here??? end This just gets the first columns value, but, how can I search in all? = Thanks for the replies: Hungarista
On 7/30/07, Attila <ejj...@gm...> wrote: > Hi all! > > I am very new in wxLUA, I find it in LUA-A-I-O. I made a little Welcome. > It appears as it must be: 7 columns with grids. I want to search on each > lines when something will be written into a textbox, so search through the > added lines. > for i = 0,tListBoxes["lst_reghubs"]:GetItemCount() - 1 do > local thishub = tListBoxes["lst_reghubs"]:GetItemText(i) > -- ... Something here??? > end > This just gets the first columns value, but, how can I search in all? > Thanks for the replies: This is untested, but it works something like this. See the bindings.wx.lua sample for an example of using the wxListCtrl. http://www.wxwidgets.org/manuals/stable/wx_wxlistctrl.html#wxlistctrlsetitem http://www.wxwidgets.org/manuals/stable/wx_wxlistitem.html#wxlistitem local listItem = wx.wxListItem() listItem:SetId(row#) listItem:SetMask(wx.wxLIST_MASK_TEXT) listCtrl:GetColumn(col#, listItem) print(listItem:GetText()) Regards, John Labenski
I feel I am close, but still dont know. Code: dialog:Connect(tTextBoxes.wxID_TXT_FILTER,wx.wxEVT_COMMAND_TEXT_UPDATED,= function(event) --tTextBoxes["txt_filter"]:GetValue() for i =3D 0,tListBoxes["lst_reghubs"]:GetItemCount() - 1 do for idx =3D 0,tListBoxes["lst_reghubs"]:GetColumnCount() - 1 do local listItem =3D wx.wxListItem() listItem:SetId(i) listItem:SetMask(wx.wxLIST_MASK_TEXT) tListBoxes["lst_reghubs"]:GetColumn(idx, listItem) wx.wxMessageBox(listItem:GetText()) end end end) Now it writes the columnnames so many times the many elements are in the= = ListCtrl. What I want is the column values for each element. I've read = through the manual many times, but I still don't understand. By the way,= = thanks for the fast reply.
On 7/30/07, Attila <ejj...@gm...> wrote: > I feel I am close, but still dont know. > Code: > dialog:Connect(tTextBoxes.wxID_TXT_FILTER,wx.wxEVT_COMMAND_TEXT_UPDATED, > function(event) > --tTextBoxes["txt_filter"]:GetValue() > for i = 0,tListBoxes["lst_reghubs"]:GetItemCount() - 1 do > for idx = 0,tListBoxes["lst_reghubs"]:GetColumnCount() - 1 do > local listItem = wx.wxListItem() > listItem:SetId(i) > listItem:SetMask(wx.wxLIST_MASK_TEXT) > tListBoxes["lst_reghubs"]:GetColumn(idx, listItem) > wx.wxMessageBox(listItem:GetText()) > end > end > end) > Now it writes the columnnames so many times the many elements are in the > ListCtrl. What I want is the column values for each element. I've read > through the manual many times, but I still don't understand. By the way, > thanks for the fast reply. Ok, this is tested. local li = wx.wxListItem() li:SetId(#row) li:SetColumn(#col) li:SetMask(wx.wxLIST_MASK_TEXT) listCtrl:GetItem(li) print(li:GetText()) Hope this helps, John Labenski ps. If you use wxLuaEditor you can use print() statements and also use the "output" window to get at variables in your program to try things by hand. If you use wxLua.exe you can use the -c switch to get a console to display the output instead of using a wxMessageBox.