wx.StdDialogButtonSizer() and wx.ID_SAVE

Martin,

I'm trying to learn wxPython, so I used your question as an excuse for
digging into the C++ code. Thanks.

The code appears to be in sizer.cpp.

It looks a wx.StdDialogButtonSizer can have up to one button for
Affirmative, Apply, Negative, Cancel and Help.

Affirmative Buttons have ids of wx.ID_OK, wx.ID_YES or wx.ID_SAVE
The Negative Button has the id of wx.ID_NO
The Apply Button has the id of wx.ID_APPLY
The Cancel Buttons has the id of wx.ID_CANCEL
Help Buttons have ids of wx.ID_HELP or wx.ID_CONTEXT_HELP

Since your example had an OK button, the sizer would not accept the Save
button. I created a test from your example and if I remove the OK
button, the Save button does show up in the right place.

Mark

ยทยทยท

On Wed, 2008-02-06 at 20:03 +0100, Martin Landa wrote:

Hi,

sorry for a newbie question, I have problem to place Save button in
StdDialogButtonSizer.

        # buttons
        btnSave = wx.Button(self, wx.ID_SAVE)
        btnApply = wx.Button(self, wx.ID_APPLY)
        ...

        # sizer
        btnSizer = wx.StdDialogButtonSizer()
        btnSizer.AddButton(btnCancel)
        btnSizer.AddButton(btnSave)
        btnSizer.AddButton(btnApply)
        btnSizer.AddButton(btnOk)
        btnSizer.Realize()

result

http://josef.fsv.cvut.cz/~landa/wxpython/save_button.png

I tried to google it, maybe I am overlooking something. Or simply
wx.ID_SAVE is not supported by this class?

Thanks! Martin