2
# This file is part of GNU Enterprise.
4
# GNU Enterprise is free software; you can redistribute it
5
# and/or modify it under the terms of the GNU General Public
6
# License as published by the Free Software Foundation; either
7
# version 2, or (at your option) any later version.
9
# GNU Enterprise is distributed in the hope that it will be
10
# useful, but WITHOUT ANY WARRANTY; without even the implied
11
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12
# PURPOSE. See the GNU General Public License for more details.
14
# You should have received a copy of the GNU General Public
15
# License along with program; see the file COPYING. If not,
16
# write to the Free Software Foundation, Inc., 59 Temple Place
17
# - Suite 330, Boston, MA 02111-1307, USA.
19
# Copyright 2002-2005 Free Software Foundation
31
# TODO: this looks strangely like another MsgBox class -- is it really
34
from constants import *
35
from Button import Button
36
from Label import Label
37
from Dialog import Dialog
39
class MsgBoxYesNo(Dialog):
40
""" a small dialog ask yes/no questions
42
def __init__(self, Parent, Message, **properties):
43
SIOInstance = Parent.Screen()
44
sMCOL = SIOInstance.MAXCOL
45
sMROW = SIOInstance.MAXROW
47
DialogWidth = MsgLen + 4
53
r1 = (sMROW - DialogHeight) / 2
54
r2 = r1 + DialogHeight
56
c1 = (sMCOL - DialogWidth) / 2
59
Dialog.__init__(self, Parent, r1, c1, r2, c2, **properties)
60
tCmdYes = Button(self, "YesBtn", 5, (DialogWidth - 7) / 4, 7, "Yes")
62
self.AddDialogControl(tCmdYes)
63
tCmdNo = Button(self, "NoBtn", 5, 2 + (2 * ((DialogWidth - 7)) / 4), 7, "No")
65
self.AddDialogControl(tCmdNo)
66
self.AddDialogControl(Label(self, "TheMsg", 1, 2, Message))
69
self.Screen().LoLight()
75
# Menu-System (Items, Menus, MenuBar)