Commit 86158072 authored by Jack Jansen's avatar Jack Jansen

Partially converted to Appearance, the dialog still has the old ugly layout and

interaction.
parent b59ea34d
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
from Dlg import * from Dlg import *
from Events import * from Events import *
from Res import * from Res import *
import Controls
import string import string
import struct import struct
import macfs import macfs
...@@ -64,24 +65,24 @@ OD_HELP_ITEM = 22 ...@@ -64,24 +65,24 @@ OD_HELP_ITEM = 22
def optinteract(options): def optinteract(options):
"""Let the user interact with the options dialog""" """Let the user interact with the options dialog"""
d = GetNewDialog(OPT_DIALOG_ID, -1) d = GetNewDialog(OPT_DIALOG_ID, -1)
tp, h, rect = d.GetDialogItem(OD_CREATOR_ITEM) htext = d.GetDialogItemAsControl(OD_CREATOR_ITEM)
SetDialogItemText(h, options['creator']) SetDialogItemText(htext, options['creator'])
tp, h, rect = d.GetDialogItem(OD_TYPE_ITEM) htext = d.GetDialogItemAsControl(OD_TYPE_ITEM)
SetDialogItemText(h, options['type']) SetDialogItemText(htext, options['type'])
d.SetDialogDefaultItem(OD_OK_ITEM) d.SetDialogDefaultItem(OD_OK_ITEM)
d.SetDialogCancelItem(OD_CANCEL_ITEM) d.SetDialogCancelItem(OD_CANCEL_ITEM)
while 1: while 1:
for name in opt_dialog_dict.keys(): for name in opt_dialog_dict.keys():
num = opt_dialog_dict[name] num = opt_dialog_dict[name]
tp, h, rect = d.GetDialogItem(num) ctl = d.GetDialogItemAsControl(num)
h.as_Control().SetControlValue(options[name]) ctl.SetControlValue(options[name])
n = ModalDialog(None) n = ModalDialog(None)
if n == OD_OK_ITEM: if n == OD_OK_ITEM:
tp, h, rect = d.GetDialogItem(OD_CREATOR_ITEM) htext = d.GetDialogItemAsControl(OD_CREATOR_ITEM)
ncreator = GetDialogItemText(h) ncreator = GetDialogItemText(htext)
tp, h, rect = d.GetDialogItem(OD_TYPE_ITEM) htext = d.GetDialogItemAsControl(OD_TYPE_ITEM)
ntype = GetDialogItemText(h) ntype = GetDialogItemText(htext)
if len(ncreator) == 4 and len(ntype) == 4: if len(ncreator) == 4 and len(ntype) == 4:
options['creator'] = ncreator options['creator'] = ncreator
options['type'] = ntype options['type'] = ntype
...@@ -107,11 +108,12 @@ def interact(options, title): ...@@ -107,11 +108,12 @@ def interact(options, title):
except os.error: except os.error:
pass pass
d = GetNewDialog(DIALOG_ID, -1) d = GetNewDialog(DIALOG_ID, -1)
tp, h, rect = d.GetDialogItem(TITLE_ITEM) htext = d.GetDialogItemAsControl(TITLE_ITEM)
SetDialogItemText(h, title) SetDialogItemText(htext, title)
tp, h, rect = d.GetDialogItem(TEXT_ITEM) ctl = d.GetDialogItemAsControl(TEXT_ITEM)
## SetDialogItemText(h, string.joinfields(list, '\r')) data = string.joinfields(options['path'], '\r')
h.data = string.joinfields(options['path'], '\r') ctl.SetControlData(Controls.kControlEditTextPart, Controls.kControlEditTextTextTag, data)
d.SelectDialogItemText(TEXT_ITEM, 0, 32767) d.SelectDialogItemText(TEXT_ITEM, 0, 32767)
d.SelectDialogItemText(TEXT_ITEM, 0, 0) d.SelectDialogItemText(TEXT_ITEM, 0, 0)
## d.SetDialogDefaultItem(OK_ITEM) ## d.SetDialogDefaultItem(OK_ITEM)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment