Search found 77 matches

by bloodlee
Tue Jun 03, 2008 1:13 am
Forum: C++ Development
Topic: [wxGTK]Call wxListBox::Select can not select the item?
Replies: 2
Views: 569

Thanks for your reply, ONEEYEMAN. I think I've found the reason. That's because when I call that function, the wxListBox's parent panel is disabled. And I made another sample to test. I found if the wxListBox using wxGTK is disabled, some APIs will do nothing, like Select(), SetSelection(), GetSelec...
by bloodlee
Thu May 29, 2008 5:54 am
Forum: C++ Development
Topic: [wxGTK]Call wxListBox::Select can not select the item?
Replies: 2
Views: 569

[wxGTK]Call wxListBox::Select can not select the item?

Hi, all. I met a problem when I use wxListBox::Select. The code is below. void StudentDialog::SelectName(const wxString& strName) { int nCount = m_pName->GetCount(); for (int i = 0; i < nCount; ++i) { if (m_pName->GetString(i) == strName) { m_pName->Select(i); break; } } } I compile this code using ...
by bloodlee
Thu May 15, 2008 12:57 am
Forum: C++ Development
Topic: How to get selected rows of wxGrid?
Replies: 6
Views: 2512

Hi,

I compiled the sample/grid and read the src. And I change the EVT_macro to EVT_GRID_SELECT_CELL and EVT_GRID_RANGE_SELECT.

But I can't get the right selected rows in the event handler, even I used the method which lester said.
by bloodlee
Wed May 14, 2008 2:34 am
Forum: C++ Development
Topic: How to get selected rows of wxGrid?
Replies: 6
Views: 2512

Thanks, Jim and lester.

I've tried your methods, but the problem still exists. :(
by bloodlee
Tue May 13, 2008 8:39 am
Forum: C++ Development
Topic: How to get selected rows of wxGrid?
Replies: 6
Views: 2512

How to get selected rows of wxGrid?

Hi, all. I met another problem about wxGrid. Now, when I left click the rows of wxGrid, I want to get how many rows has been selected. So I use: BEGIN_EVENT_TABLE(RecordGrid, wxGrid) EVT_GRID_CELL_LEFT_CLICK(RecordGrid::OnLeftClick) END_EVENT_TABLE() void RecordGrid::OnLeftClick(wxGridEvent& event) ...
by bloodlee
Mon May 05, 2008 2:49 am
Forum: C++ Development
Topic: Memory leak of grid cell renderer
Replies: 5
Views: 811

Hi, I think I found the reason after I checked the src of wx2.6.2. ShowLineCellRenderer* pRenderer = dynamic_cast<ShowLineCellRenderer*>(m_pLineGrid->GetCellRenderer(iRowIndex, LineManagerView::VISIBILITY)); pRenderer->SetShowFlag(pLine->GetShown()); m_pLineGrid->Refresh(); GetCellRenderer() which w...
by bloodlee
Mon May 05, 2008 2:05 am
Forum: C++ Development
Topic: Memory leak of grid cell renderer
Replies: 5
Views: 811

I'm sorry for the confusing post. I just wanted to show how I used the renderer in my first post. Actually the renderer GridCellBmpRenderer was written by my friend. I wrote the ShowLineCellRenderer. ShowLineCellRenderer is derived from wxGridCellRenderer, which is a abstract class. And Clone functi...
by bloodlee
Sun May 04, 2008 6:38 am
Forum: C++ Development
Topic: Memory leak of grid cell renderer
Replies: 5
Views: 811

The code is shown below: class ShowLineCellRenderer : public wxGridCellRenderer { public: explicit ShowLineCellRenderer(bool bShowLine = true) : m_bShowLine(bShowLine) {} ~ShowLineCellRenderer() {} virtual void Draw(wxGrid& grid, wxGridCellAttr& attr, wxDC& dc, const wxRect& rect, int row, int col, ...
by bloodlee
Wed Apr 30, 2008 8:53 am
Forum: C++ Development
Topic: Memory leak of grid cell renderer
Replies: 5
Views: 811

Memory leak of grid cell renderer

Hi, all. I am using wx2.6.2 to develop. And I used wxGrid to show something. Today I found my program has memory leak and the point is shown below. m_pGrid->SetCellRenderer(index, 0, new GridCellBmpRenderer); And later I checked the manual about wxGrid::SetCellRenderer() and it said "The grid will t...
by bloodlee
Wed Apr 09, 2008 1:19 am
Forum: C++ Development
Topic: How to save wxDC to a bmp or jpg file?
Replies: 2
Views: 530

It seems easy. Thanks. :D
by bloodlee
Wed Apr 09, 2008 1:07 am
Forum: C++ Development
Topic: How to save wxDC to a bmp or jpg file?
Replies: 2
Views: 530

How to save wxDC to a bmp or jpg file?

Hi, all.
How to save the dc to a picture file(.bmp, .jpg)?
Thanks.
by bloodlee
Fri Mar 28, 2008 3:10 pm
Forum: C++ Development
Topic: Can I add a menubar to a panel or just a frame?
Replies: 4
Views: 933

Thanks, guys. I will try. :D
by bloodlee
Fri Mar 28, 2008 9:32 am
Forum: C++ Development
Topic: Can I add a menubar to a panel or just a frame?
Replies: 4
Views: 933

Can I add a menubar to a panel or just a frame?

Hi, all.
I just want to ask if a menubar can be inserted to a panel. Is that possible? It seems that only the class wxFrame has the SetMenuBar().

Thanks.
by bloodlee
Fri Mar 14, 2008 6:37 am
Forum: C++ Development
Topic: Call eventhandler in objects
Replies: 2
Views: 422

Maybe you'd better to write a single wxEvtHandler for your wxTreeView Ctrl, like SpecialKeyEvtHandler, which will trap all key events. And in your code, you can use PushEvevtHandler() function to let it work, like: wxTreeView* pTree =..... pTree->PushEventHandler(new SpecialKeyEvtHandler(...)). I ho...
by bloodlee
Mon Mar 10, 2008 11:25 am
Forum: C++ Development
Topic: How to handle the un-selected event of wxListBox in wx 2.6.2
Replies: 1
Views: 249

Maybe I can handle the event of mouse-button-up.