Search found 51 matches

by shawnee
Tue Feb 12, 2019 11:40 am
Forum: C++ Development
Topic: How to get the actual size of panel?
Replies: 3
Views: 89

Re: How to get the actual size of panel?

forgive my stupid, I hiden the panel in another place, so the size is always zero.
by shawnee
Thu Jan 31, 2019 4:17 am
Forum: C++ Development
Topic: How to get the actual size of panel?
Replies: 3
Views: 89

Re: How to get the actual size of panel?

Thanks PB! The real things is something complicated. I created a panel and add this panel to a wxAuiManager. Although I set a initial size for this parent panel, but the real size should be larger than the initial size because of stretch by AUI manager. wxPanel *topPanel = new wxPanel(mainFrame); //...
by shawnee
Wed Jan 30, 2019 12:59 pm
Forum: C++ Development
Topic: How to get the actual size of panel?
Replies: 3
Views: 89

How to get the actual size of panel?

if I add a panel to it's parent window without set the size of this panel, how to knonw its actual size? wxBoxSizer * vSizer = parent->GetSizer(); wxPanel * subPanel = new wxPanel(parent, "Ok", wxID_ANY, wxDefaultPosition, wxDefaultSize); vSizer ->Add(subPanel, 0, wxEXPAND | wxALL); wxSize sz = subP...
by shawnee
Fri Dec 07, 2018 6:21 am
Forum: C++ Development
Topic: alignment problem of vertical style toolbar
Replies: 3
Views: 104

Re: alignment problem of vertical style toolbar

ONEEYEMAN wrote:Hi,
Is it reproducible in the toolbar sample?

Thank you.
the codes are not from wxWidgets toolbar sample.
this toolbar is just as an embeded controls into a ribbon panel.
by shawnee
Thu Dec 06, 2018 7:18 am
Forum: C++ Development
Topic: alignment problem of vertical style toolbar
Replies: 3
Views: 104

alignment problem of vertical style toolbar

I created a vertical sytle wxToolbar(wxTB_VERTICAL | wxTB_FLAT | wxTB_NODIVIDER | wxTB_HORZ_LAYOUT | wxTB_TEXT). The upper toolbutton is a normal button. The lower toolbutton is a button with dropdown menu. Both of buttons have the same icon(16x16). As you see, they are not left-alignment. How could...
by shawnee
Fri Nov 23, 2018 8:12 am
Forum: Component Writing
Topic: Dark skinned application that flashes when started
Replies: 12
Views: 1230

Re: Dark skinned application that flashes when started

Hi, I am developing a dark "skinned" application with buttons, check boxes, ... each derived form wxPanel or wxWindow. Everything works fine but when the application starts and the main frame is displayed, all the skinned objects flash once (it's very fast) as white rectangles just before been disp...
by shawnee
Sat Nov 17, 2018 12:14 pm
Forum: C++ Development
Topic: How to set font for one of toolbutton in wxToolbar?
Replies: 13
Views: 334

Re: How to set font for one of toolbutton in wxToolbar?

doublemax wrote:You should also ask yourself if this all is worth the effort. It'll be an unusual GUI design element to say the least, i don't think i've ever seen this anywhere.
Anyway, I still think it is strange there is no member function to set font for label of individual toolbutton.
by shawnee
Sat Nov 17, 2018 2:46 am
Forum: C++ Development
Topic: How to set font for one of toolbutton in wxToolbar?
Replies: 13
Views: 334

Re: How to set font for one of toolbutton in wxToolbar?

ONEEYEMAN wrote:Hi,
What if you try to add control to toolbar and use wxBitmapButton?

Thank you.
it's good idea, but how can I let wxButton as flat style just looks like toolbutton on wxToolBar?
by shawnee
Sat Nov 17, 2018 1:08 am
Forum: C++ Development
Topic: How to set font for one of toolbutton in wxToolbar?
Replies: 13
Views: 334

Re: How to set font for one of toolbutton in wxToolbar?

I thought out a trick way to show different(bold) font on a toolbutton. That's render icon and bold font label into a bitmap together, then set this rendered bitmap as the bitmap of this toolbutton. There are two difficult obstacles to me. 1. each of label has different length(but the lenght of stri...
by shawnee
Sat Nov 17, 2018 12:58 am
Forum: C++ Development
Topic: Is it possible to do drag&drop on toolbutton of wxToolBar?
Replies: 12
Views: 478

Re: Is it possible to do drag&drop on toolbutton of wxToolBar?

doublemax wrote:If the button should still work when clicked, i can't think of any way to avoid that.
Is it possible to cancel/kill the mouse dragging status when do dragging on not be draggable toolbutotn?
by shawnee
Fri Nov 16, 2018 2:11 pm
Forum: C++ Development
Topic: Is it possible to do drag&drop on toolbutton of wxToolBar?
Replies: 12
Views: 478

Re: Is it possible to do drag&drop on toolbutton of wxToolBar?

int wxItemid = base->GetId(); You have identified the toolbutton here. If it's a button that should not be draggable, just do nothing. BTW: You should call event.Skip() if you don't start a dragging operation, so that the default event handling takes place. event.Skip() works, but the toolbutton th...
by shawnee
Fri Nov 16, 2018 1:08 pm
Forum: C++ Development
Topic: Is it possible to do drag&drop on toolbutton of wxToolBar?
Replies: 12
Views: 478

Re: Is it possible to do drag&drop on toolbutton of wxToolBar?

If some of toolbuttons couldn't do drag on wxToolBar, how to cancel the dragging? I'm not 100% sure i understand what you mean. Can you use wxToolBar::FindToolForPosition() to identify the tool you clicked on? I bind event like this: wxToolBar * PToolbar = new wxToolBar (...) PToolbar->Bind(wxEVT_M...
by shawnee
Fri Nov 16, 2018 7:43 am
Forum: C++ Development
Topic: Is it possible to do drag&drop on toolbutton of wxToolBar?
Replies: 12
Views: 478

Re: Is it possible to do drag&drop on toolbutton of wxToolBar?

I tried dragging operation on toolbutton, it would not trigger single clicking event on this toolbutton. It will not trigger a dedicated drag event, but if you catch generic mouse events and check wxMouseEvent::Dragging() it should be possible to start a drag operation from there. Hi doublemax, If ...
by shawnee
Fri Nov 16, 2018 3:11 am
Forum: C++ Development
Topic: Is it possible to do drag&drop on toolbutton of wxToolBar?
Replies: 12
Views: 478

Re: Is it possible to do drag&drop on toolbutton of wxToolBar?

I tried dragging operation on toolbutton, it would not trigger single clicking event on this toolbutton. It will not trigger a dedicated drag event, but if you catch generic mouse events and check wxMouseEvent::Dragging() it should be possible to start a drag operation from there. It's settled down...
by shawnee
Thu Nov 15, 2018 12:52 pm
Forum: C++ Development
Topic: Is it possible to do drag&drop on toolbutton of wxToolBar?
Replies: 12
Views: 478

Re: Is it possible to do drag&drop on toolbutton of wxToolBar?

As wxToolBar derives from wxWindow, it should work as a drop target (wxWindow::SetDropTarget). Then you could use wxToolBar::FindToolForPosition() to find the button where the drop happened. But i can't think of any way to start a drag from a toolbar button if a click on that button should also wor...