Search found 20 matches

by greekfellows
Tue Nov 25, 2014 3:14 pm
Forum: C++ Development
Topic: adding wxScrolledWindow into a sizer
Replies: 3
Views: 1062

Re: adding wxScrolledWindow into a sizer

@doublemax thanks! those were the actual problems... I was very careless during all that copying-and-pasting.

@RemcoM yes, actually I used a design similar to yours in the actual code, but here I omitted all that unnecessary layout stuff to keep the code readable. thanks anyway!
by greekfellows
Tue Nov 25, 2014 12:43 pm
Forum: C++ Development
Topic: adding wxScrolledWindow into a sizer
Replies: 3
Views: 1062

adding wxScrolledWindow into a sizer

I'm trying to make such a wxWindow-derived window that will later be added into another wxFrame-derived frame: layout.PNG Here's the code for the window: myWindow.h #include <wx/wx.h> class myWindow: public wxWindow { public: wxBoxSizer *mainVBox, *addRemoveHBox; wxButton *addButton, *removeButton; ...
by greekfellows
Wed Oct 01, 2014 7:47 am
Forum: C++ Development
Topic: editable toggle in wxDataViewListCtrl
Replies: 4
Views: 1083

Re: editable toggle in wxDataViewListCtrl

@doublemax thanks, it works perfectly in 3.1.0!
by greekfellows
Tue Sep 30, 2014 3:27 pm
Forum: C++ Development
Topic: editable toggle in wxDataViewListCtrl
Replies: 4
Views: 1083

Re: editable toggle in wxDataViewListCtrl

@doublemax Windows, x64, wxWidgets 3.0.0.

No, it didn't work in the dataview sample either.
Is this a platform-specific problem?
by greekfellows
Tue Sep 30, 2014 2:23 pm
Forum: C++ Development
Topic: editable toggle in wxDataViewListCtrl
Replies: 4
Views: 1083

editable toggle in wxDataViewListCtrl

I made a wxDataViewListCtrl and used appendToggleColumn, but none of the toggles in that column are editable.
That is, the user can't check or uncheck the toggles.

How do I implement an editable toggle?
by greekfellows
Mon Sep 22, 2014 7:24 am
Forum: C++ Development
Topic: Drawing shapes and controls
Replies: 3
Views: 732

Re: Drawing shapes and controls

@Manolo thanks! I'm trying this out. What I want is essentially to draw shapes in a wxPanel (like how we usually do with wxDC and have a wxPanel handle the wxEVT_PAINT); and at the same time, draw controls like buttons and check boxes in the shapes. I guess this is really going to be a huge effort b...
by greekfellows
Fri Sep 19, 2014 4:46 pm
Forum: C++ Development
Topic: Drawing shapes and controls
Replies: 3
Views: 732

Drawing shapes and controls

I want to draw shapes with fill and stroke colors which I can specify, and within those shapes I want to draw controls like check boxes.

I know shapes are usually drawn with wxDC-derived classes, but is there such a way I can integrate controls in it?
by greekfellows
Mon Sep 15, 2014 4:25 pm
Forum: C++ Development
Topic: wxScrolledWindow looks weird on the right side of a sizer
Replies: 3
Views: 766

Re: wxScrolledWindow looks weird on the right side of a size

@doublemax unfortunately, my code is dependent on OpenCV, so this is a modified version of it. first I have this bmImage which is derived from wxPanel: ( constructor bmImage() loads a sample.jpg ) bmImage.h class bmImage : public wxPanel { public: wxImage aswxImage; wxBitmap bitmap; bmImage(wxFrame*...
by greekfellows
Sun Sep 14, 2014 4:36 pm
Forum: C++ Development
Topic: wxScrolledWindow looks weird on the right side of a sizer
Replies: 3
Views: 766

wxScrolledWindow looks weird on the right side of a sizer

someSizer is the wxFlexGridSizer containing the image. someScrolledWindow is the wxScrolledWindow containing a wxTextCtrl and a wxCheckListBox (scroll bars not shown). sizer->Add(someScrolledWindow, 1, wxEXPAND); sizer->Add(someSizer, 1, wxEXPAND); 捕获.PNG this looks fine. but: sizer->Add(someSizer, ...
by greekfellows
Thu Sep 11, 2014 10:56 am
Forum: C++ Development
Topic: drawing wxBitmap: doesn't refresh before every time it draws
Replies: 6
Views: 2092

Re: drawing wxBitmap: doesn't refresh before every time it d

Thanks! @eranif @doublemax

Used Refresh() in paintNow() and called SetBackgroundStyle().
Now it doesn't flicker at all.
by greekfellows
Wed Sep 10, 2014 4:55 pm
Forum: C++ Development
Topic: drawing wxBitmap: doesn't refresh before every time it draws
Replies: 6
Views: 2092

Re: drawing wxBitmap: doesn't refresh before every time it d

Thanks for answers so far @eranif @PB! I intercepted the wxEVT_SIZE event and called event.Skip() there so it refreshes every time it draws now, that's fine, but now I have a flickering white screen (I used white to repaint a full-size rectangle)... void bmImage::paintEvent(wxPaintEvent &event) { wx...
by greekfellows
Mon Sep 08, 2014 4:29 pm
Forum: C++ Development
Topic: drawing wxBitmap: doesn't refresh before every time it draws
Replies: 6
Views: 2092

drawing wxBitmap: doesn't refresh before every time it draws

void bmImage::paintEvent(wxPaintEvent &event) { wxPaintDC dc(this); render(dc); } void bmImage::paintNow() { wxClientDC dc(this); render(dc); } void bmImage::render(wxDC& dc) { bitmap = wxBitmap(aswxImage); dc.Clear(); dc.SetUserScale(((bmImageFrame*)this->GetParent())->scale[0], ((bmImageFrame*)th...
by greekfellows
Sun Sep 07, 2014 11:55 am
Forum: C++ Development
Topic: wxWidgets + OpenCV: wxBitmap does not draw wxImage correctly
Replies: 6
Views: 2302

Re: wxWidgets + OpenCV: wxBitmap does not draw wxImage corre

Ahh, I forgot to

Code: Select all

sizer->SetSizeHints(window)
Now it works perfectly. @doublemax many thanks!
by greekfellows
Sun Sep 07, 2014 11:52 am
Forum: C++ Development
Topic: wxWidgets + OpenCV: wxBitmap does not draw wxImage correctly
Replies: 6
Views: 2302

Re: wxWidgets + OpenCV: wxBitmap does not draw wxImage corre

@doublemax Yes, bmImage is derived from wxPanel.

I tried

Code: Select all

sizer->Add(bmimage, 1, wxEXPAND)
but the image still doesn't show correctly.
by greekfellows
Sun Sep 07, 2014 11:10 am
Forum: C++ Development
Topic: wxWidgets + OpenCV: wxBitmap does not draw wxImage correctly
Replies: 6
Views: 2302

Re: wxWidgets + OpenCV: wxBitmap does not draw wxImage corre

@doublemax Thanks! I tried exporting an image but it came out with blues and reds swapped with each other... probably because Windows use BGR instead of RGB. I then did a RGB2BGR conversion and it worked. The exported image was correct, which means that wxImage accepted the OpenCV format, so I think...