| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- """
- This file is part of RuneOptimizer.
- RuneOptimizer is free software: you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the Free
- Software Foundation, either version 3 of the License, or (at your option)
- any later version.
- RuneOptimizer is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- more details.
- You should have received a copy of the GNU General Public License along with
- RuneOptimizer. If not, see <https://www.gnu.org/licenses/>.
- """
- class DialogConfirm(wx.Dialog):
- """
- Dialog for confirmations.
- """
- def __init__(self, parent, id=wx.ID_ANY, message="Proceed?"):
- """Initializes the dialog.
- Sets upt all the widgets.
- Parameters
- ----------
- parent : wx.*
- Dialog parent.
- id : int, optional
- ID for the dialig (default wx.ID_ANY).
- message : string
- Message for the dialog.
- """
- # Parent constructor
- wx.Dialog.__init__(
- self, parent=parent, id=id, pos=(50, 50), size=(240, 180),
- title="Confirm action", style=wx.DEFAULT_DIALOG_STYLE
- )
- wx.StaticText(
- parent=self, id=wx.ID_ANY, label=message,
- pos=(10, 10), size=(220, 80), style=wx.ALIGN_CENTRE_HORIZONTAL
- )
- btYes = wx.Button(
- parent=self, id=wx.ID_OK, pos=(26, 100),
- size=(80, 40), style=wx.LC_REPORT, label="Yes"
- )
- btNo = wx.Button(
- parent=self, id=wx.ID_CANCEL, pos=(132, 100),
- size=(80, 40), style=wx.LC_REPORT, label="No"
- )
|