本文整理匯總了Python中msilib.Dialog.text方法的典型用法代碼示例。如果您正苦於以下問題:Python Dialog.text方法的具體用法?Python Dialog.text怎麽用?Python Dialog.text使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類msilib.Dialog
的用法示例。
在下文中一共展示了Dialog.text方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: add_ui
# 需要導入模塊: from msilib import Dialog [as 別名]
# 或者: from msilib.Dialog import text [as 別名]
def add_ui(self):
db = self.db
x = y = 50
w = 370
h = 300
title = "[ProductName] Setup"
modal = 3
modeless = 1
add_data(
db,
"Property",
[
("DefaultUIFont", "DlgFont8"),
("ErrorDialog", "ErrorDlg"),
("Progress1", "Install"),
("Progress2", "installs"),
("MaintenanceForm_Action", "Repair"),
("WhichUsers", "ALL"),
],
)
add_data(
db,
"TextStyle",
[
("DlgFont8", "Tahoma", 9, None, 0),
("DlgFontBold8", "Tahoma", 8, None, 1),
("VerdanaBold10", "Verdana", 10, None, 1),
("VerdanaRed9", "Verdana", 9, 255, 0),
],
)
add_data(
db,
"InstallUISequence",
[
("PrepareDlg", "Not Privileged or Windows9x or Installed", 140),
("WhichUsersDlg", "Privileged and not Windows9x and not Installed", 141),
("SelectFeaturesDlg", "Not Installed", 1230),
("MaintenanceTypeDlg", "Installed AND NOT RESUME AND NOT Preselected", 1250),
("ProgressDlg", None, 1280),
],
)
add_data(db, "ActionText", text.ActionText)
add_data(db, "UIText", text.UIText)
fatal = PyDialog(db, "FatalError", x, y, w, h, modal, title, "Finish", "Finish", "Finish")
fatal.title("[ProductName] Installer ended prematurely")
fatal.back("< Back", "Finish", active=0)
fatal.cancel("Cancel", "Back", active=0)
fatal.text(
"Description1",
15,
70,
320,
80,
196611,
"[ProductName] setup ended prematurely because of an error. Your system has not been modified. To install this program at a later time, please run the installation again.",
)
fatal.text("Description2", 15, 155, 320, 20, 196611, "Click the Finish button to exit the Installer.")
c = fatal.next("Finish", "Cancel", name="Finish")
c.event("EndDialog", "Exit")
user_exit = PyDialog(db, "UserExit", x, y, w, h, modal, title, "Finish", "Finish", "Finish")
user_exit.title("[ProductName] Installer was interrupted")
user_exit.back("< Back", "Finish", active=0)
user_exit.cancel("Cancel", "Back", active=0)
user_exit.text(
"Description1",
15,
70,
320,
80,
196611,
"[ProductName] setup was interrupted. Your system has not been modified. To install this program at a later time, please run the installation again.",
)
user_exit.text("Description2", 15, 155, 320, 20, 196611, "Click the Finish button to exit the Installer.")
c = user_exit.next("Finish", "Cancel", name="Finish")
c.event("EndDialog", "Exit")
exit_dialog = PyDialog(db, "ExitDialog", x, y, w, h, modal, title, "Finish", "Finish", "Finish")
exit_dialog.title("Completing the [ProductName] Installer")
exit_dialog.back("< Back", "Finish", active=0)
exit_dialog.cancel("Cancel", "Back", active=0)
exit_dialog.text("Description", 15, 235, 320, 20, 196611, "Click the Finish button to exit the Installer.")
c = exit_dialog.next("Finish", "Cancel", name="Finish")
c.event("EndDialog", "Return")
inuse = PyDialog(db, "FilesInUse", x, y, w, h, 19, title, "Retry", "Retry", "Retry", bitmap=False)
inuse.text("Title", 15, 6, 200, 15, 196611, "{\\DlgFontBold8}Files in Use")
inuse.text("Description", 20, 23, 280, 20, 196611, "Some files that need to be updated are currently in use.")
inuse.text(
"Text",
20,
55,
330,
50,
3,
"The following applications are using files that need to be updated by this setup. Close these applications and then click Retry to continue the installation or Cancel to exit it.",
)
inuse.control("List", "ListBox", 20, 107, 330, 130, 7, "FileInUseProcess", None, None, None)
c = inuse.back("Exit", "Ignore", name="Exit")
c.event("EndDialog", "Exit")
c = inuse.next("Ignore", "Retry", name="Ignore")
c.event("EndDialog", "Ignore")
c = inuse.cancel("Retry", "Exit", name="Retry")
#.........這裏部分代碼省略.........
示例2: add_ui
# 需要導入模塊: from msilib import Dialog [as 別名]
# 或者: from msilib.Dialog import text [as 別名]
def add_ui(self):
db = self.db
x = y = 50
w = 370
h = 300
title = "[ProductName] Setup"
# see "Dialog Style Bits"
modal = 3 # visible | modal
modeless = 1 # visible
track_disk_space = 32
# UI customization properties
add_data(db, "Property",
# See "DefaultUIFont Property"
[("DefaultUIFont", "DlgFont8"),
# See "ErrorDialog Style Bit"
("ErrorDialog", "ErrorDlg"),
("Progress1", "Install"), # modified in maintenance type dlg
("Progress2", "installs"),
("MaintenanceForm_Action", "Repair"),
# possible values: ALL, JUSTME
("WhichUsers", "ALL")
])
# Fonts, see "TextStyle Table"
add_data(db, "TextStyle",
[("DlgFont8", "Tahoma", 9, None, 0),
("DlgFontBold8", "Tahoma", 8, None, 1), #bold
("VerdanaBold10", "Verdana", 10, None, 1),
("VerdanaRed9", "Verdana", 9, 255, 0),
])
# UI Sequences, see "InstallUISequence Table", "Using a Sequence Table"
# Numbers indicate sequence; see sequence.py for how these action integrate
add_data(db, "InstallUISequence",
[("PrepareDlg", "Not Privileged or Windows9x or Installed", 140),
("WhichUsersDlg", "Privileged and not Windows9x and not Installed", 141),
# In the user interface, assume all-users installation if privileged.
("SelectFeaturesDlg", "Not Installed", 1230),
# XXX no support for resume installations yet
#("ResumeDlg", "Installed AND (RESUME OR Preselected)", 1240),
("MaintenanceTypeDlg", "Installed AND NOT RESUME AND NOT Preselected", 1250),
("ProgressDlg", None, 1280)])
add_data(db, 'ActionText', text.ActionText)
add_data(db, 'UIText', text.UIText)
#####################################################################
# Standard dialogs: FatalError, UserExit, ExitDialog
fatal=PyDialog(db, "FatalError", x, y, w, h, modal, title,
"Finish", "Finish", "Finish")
fatal.title("[ProductName] Installer ended prematurely")
fatal.back("< Back", "Finish", active = 0)
fatal.cancel("Cancel", "Back", active = 0)
fatal.text("Description1", 15, 70, 320, 80, 0x30003,
"[ProductName] setup ended prematurely because of an error. Your system has not been modified. To install this program at a later time, please run the installation again.")
fatal.text("Description2", 15, 155, 320, 20, 0x30003,
"Click the Finish button to exit the Installer.")
c=fatal.next("Finish", "Cancel", name="Finish")
c.event("EndDialog", "Exit")
user_exit=PyDialog(db, "UserExit", x, y, w, h, modal, title,
"Finish", "Finish", "Finish")
user_exit.title("[ProductName] Installer was interrupted")
user_exit.back("< Back", "Finish", active = 0)
user_exit.cancel("Cancel", "Back", active = 0)
user_exit.text("Description1", 15, 70, 320, 80, 0x30003,
"[ProductName] setup was interrupted. Your system has not been modified. "
"To install this program at a later time, please run the installation again.")
user_exit.text("Description2", 15, 155, 320, 20, 0x30003,
"Click the Finish button to exit the Installer.")
c = user_exit.next("Finish", "Cancel", name="Finish")
c.event("EndDialog", "Exit")
exit_dialog = PyDialog(db, "ExitDialog", x, y, w, h, modal, title,
"Finish", "Finish", "Finish")
exit_dialog.title("Completing the [ProductName] Installer")
exit_dialog.back("< Back", "Finish", active = 0)
exit_dialog.cancel("Cancel", "Back", active = 0)
exit_dialog.text("Description", 15, 235, 320, 20, 0x30003,
"Click the Finish button to exit the Installer.")
c = exit_dialog.next("Finish", "Cancel", name="Finish")
c.event("EndDialog", "Return")
#####################################################################
# Required dialog: FilesInUse, ErrorDlg
inuse = PyDialog(db, "FilesInUse",
x, y, w, h,
19, # KeepModeless|Modal|Visible
title,
"Retry", "Retry", "Retry", bitmap=False)
inuse.text("Title", 15, 6, 200, 15, 0x30003,
r"{\DlgFontBold8}Files in Use")
inuse.text("Description", 20, 23, 280, 20, 0x30003,
"Some files that need to be updated are currently in use.")
inuse.text("Text", 20, 55, 330, 50, 3,
"The following applications are using files that need to be updated by this setup. Close these applications and then click Retry to continue the installation or Cancel to exit it.")
inuse.control("List", "ListBox", 20, 107, 330, 130, 7, "FileInUseProcess",
None, None, None)
c=inuse.back("Exit", "Ignore", name="Exit")
#.........這裏部分代碼省略.........
示例3: add_ui
# 需要導入模塊: from msilib import Dialog [as 別名]
# 或者: from msilib.Dialog import text [as 別名]
def add_ui(self):
db = self.db
x = y = 50
w = 370
h = 300
title = '[ProductName] Setup'
modal = 3
modeless = 1
add_data(db, 'Property', [('DefaultUIFont', 'DlgFont8'),
('ErrorDialog', 'ErrorDlg'),
('Progress1', 'Install'),
('Progress2', 'installs'),
('MaintenanceForm_Action', 'Repair'),
('WhichUsers', 'ALL')])
add_data(db, 'TextStyle', [('DlgFont8', 'Tahoma', 9, None, 0),
('DlgFontBold8', 'Tahoma', 8, None, 1),
('VerdanaBold10', 'Verdana', 10, None, 1),
('VerdanaRed9', 'Verdana', 9, 255, 0)])
add_data(db, 'InstallUISequence', [('PrepareDlg', 'Not Privileged or Windows9x or Installed', 140),
('WhichUsersDlg', 'Privileged and not Windows9x and not Installed', 141),
('SelectFeaturesDlg', 'Not Installed', 1230),
('MaintenanceTypeDlg', 'Installed AND NOT RESUME AND NOT Preselected', 1250),
('ProgressDlg', None, 1280)])
add_data(db, 'ActionText', text.ActionText)
add_data(db, 'UIText', text.UIText)
fatal = PyDialog(db, 'FatalError', x, y, w, h, modal, title, 'Finish', 'Finish', 'Finish')
fatal.title('[ProductName] Installer ended prematurely')
fatal.back('< Back', 'Finish', active=0)
fatal.cancel('Cancel', 'Back', active=0)
fatal.text('Description1', 15, 70, 320, 80, 196611, '[ProductName] setup ended prematurely because of an error. Your system has not been modified. To install this program at a later time, please run the installation again.')
fatal.text('Description2', 15, 155, 320, 20, 196611, 'Click the Finish button to exit the Installer.')
c = fatal.next('Finish', 'Cancel', name='Finish')
c.event('EndDialog', 'Exit')
user_exit = PyDialog(db, 'UserExit', x, y, w, h, modal, title, 'Finish', 'Finish', 'Finish')
user_exit.title('[ProductName] Installer was interrupted')
user_exit.back('< Back', 'Finish', active=0)
user_exit.cancel('Cancel', 'Back', active=0)
user_exit.text('Description1', 15, 70, 320, 80, 196611, '[ProductName] setup was interrupted. Your system has not been modified. To install this program at a later time, please run the installation again.')
user_exit.text('Description2', 15, 155, 320, 20, 196611, 'Click the Finish button to exit the Installer.')
c = user_exit.next('Finish', 'Cancel', name='Finish')
c.event('EndDialog', 'Exit')
exit_dialog = PyDialog(db, 'ExitDialog', x, y, w, h, modal, title, 'Finish', 'Finish', 'Finish')
exit_dialog.title('Completing the [ProductName] Installer')
exit_dialog.back('< Back', 'Finish', active=0)
exit_dialog.cancel('Cancel', 'Back', active=0)
exit_dialog.text('Description', 15, 235, 320, 20, 196611, 'Click the Finish button to exit the Installer.')
c = exit_dialog.next('Finish', 'Cancel', name='Finish')
c.event('EndDialog', 'Return')
inuse = PyDialog(db, 'FilesInUse', x, y, w, h, 19, title, 'Retry', 'Retry', 'Retry', bitmap=False)
inuse.text('Title', 15, 6, 200, 15, 196611, '{\\DlgFontBold8}Files in Use')
inuse.text('Description', 20, 23, 280, 20, 196611, 'Some files that need to be updated are currently in use.')
inuse.text('Text', 20, 55, 330, 50, 3, 'The following applications are using files that need to be updated by this setup. Close these applications and then click Retry to continue the installation or Cancel to exit it.')
inuse.control('List', 'ListBox', 20, 107, 330, 130, 7, 'FileInUseProcess', None, None, None)
c = inuse.back('Exit', 'Ignore', name='Exit')
c.event('EndDialog', 'Exit')
c = inuse.next('Ignore', 'Retry', name='Ignore')
c.event('EndDialog', 'Ignore')
c = inuse.cancel('Retry', 'Exit', name='Retry')
c.event('EndDialog', 'Retry')
error = Dialog(db, 'ErrorDlg', 50, 10, 330, 101, 65543, title, 'ErrorText', None, None)
error.text('ErrorText', 50, 9, 280, 48, 3, '')
error.pushbutton('N', 120, 72, 81, 21, 3, 'No', None).event('EndDialog', 'ErrorNo')
error.pushbutton('Y', 240, 72, 81, 21, 3, 'Yes', None).event('EndDialog', 'ErrorYes')
error.pushbutton('A', 0, 72, 81, 21, 3, 'Abort', None).event('EndDialog', 'ErrorAbort')
error.pushbutton('C', 42, 72, 81, 21, 3, 'Cancel', None).event('EndDialog', 'ErrorCancel')
error.pushbutton('I', 81, 72, 81, 21, 3, 'Ignore', None).event('EndDialog', 'ErrorIgnore')
error.pushbutton('O', 159, 72, 81, 21, 3, 'Ok', None).event('EndDialog', 'ErrorOk')
error.pushbutton('R', 198, 72, 81, 21, 3, 'Retry', None).event('EndDialog', 'ErrorRetry')
cancel = Dialog(db, 'CancelDlg', 50, 10, 260, 85, 3, title, 'No', 'No', 'No')
cancel.text('Text', 48, 15, 194, 30, 3, 'Are you sure you want to cancel [ProductName] installation?')
c = cancel.pushbutton('Yes', 72, 57, 56, 17, 3, 'Yes', 'No')
c.event('EndDialog', 'Exit')
c = cancel.pushbutton('No', 132, 57, 56, 17, 3, 'No', 'Yes')
c.event('EndDialog', 'Return')
costing = Dialog(db, 'WaitForCostingDlg', 50, 10, 260, 85, modal, title, 'Return', 'Return', 'Return')
costing.text('Text', 48, 15, 194, 30, 3, 'Please wait while the installer finishes determining your disk space requirements.')
c = costing.pushbutton('Return', 102, 57, 56, 17, 3, 'Return', None)
c.event('EndDialog', 'Exit')
prep = PyDialog(db, 'PrepareDlg', x, y, w, h, modeless, title, 'Cancel', 'Cancel', 'Cancel')
prep.text('Description', 15, 70, 320, 40, 196611, 'Please wait while the Installer prepares to guide you through the installation.')
prep.title('Welcome to the [ProductName] Installer')
c = prep.text('ActionText', 15, 110, 320, 20, 196611, 'Pondering...')
c.mapping('ActionText', 'Text')
c = prep.text('ActionData', 15, 135, 320, 30, 196611, None)
c.mapping('ActionData', 'Text')
prep.back('Back', None, active=0)
prep.next('Next', None, active=0)
c = prep.cancel('Cancel', None)
c.event('SpawnDialog', 'CancelDlg')
seldlg = PyDialog(db, 'SelectFeaturesDlg', x, y, w, h, modal, title, 'Next', 'Next', 'Cancel')
seldlg.title('Select Python Installations')
seldlg.text('Hint', 15, 30, 300, 20, 3, 'Select the Python locations where %s should be installed.' % self.distribution.get_fullname())
seldlg.back('< Back', None, active=0)
c = seldlg.next('Next >', 'Cancel')
order = 1
c.event('[TARGETDIR]', '[SourceDir]', ordering=order)
for version in self.versions + [self.other_version]:
order += 1
c.event('[TARGETDIR]', '[TARGETDIR%s]' % version, 'FEATURE_SELECTED AND &Python%s=3' % version, ordering=order)
#.........這裏部分代碼省略.........