From 6a6db0724cfa6f6d7126672be68551e49f52f063 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Thu, 23 Dec 1999 14:34:07 +0000 Subject: [PATCH] Partially converted to Appearance, the dialog still has the old ugly layout and interaction. --- Mac/scripts/EditPythonPrefs.py | 32 ++++++++++++++++--------------- Mac/scripts/EditPythonPrefs.rsrc | Bin 7925 -> 8553 bytes 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/Mac/scripts/EditPythonPrefs.py b/Mac/scripts/EditPythonPrefs.py index b882bdea9f2..e8177c69440 100644 --- a/Mac/scripts/EditPythonPrefs.py +++ b/Mac/scripts/EditPythonPrefs.py @@ -6,6 +6,7 @@ from Dlg import * from Events import * from Res import * +import Controls import string import struct import macfs @@ -64,24 +65,24 @@ OD_HELP_ITEM = 22 def optinteract(options): """Let the user interact with the options dialog""" d = GetNewDialog(OPT_DIALOG_ID, -1) - tp, h, rect = d.GetDialogItem(OD_CREATOR_ITEM) - SetDialogItemText(h, options['creator']) - tp, h, rect = d.GetDialogItem(OD_TYPE_ITEM) - SetDialogItemText(h, options['type']) + htext = d.GetDialogItemAsControl(OD_CREATOR_ITEM) + SetDialogItemText(htext, options['creator']) + htext = d.GetDialogItemAsControl(OD_TYPE_ITEM) + SetDialogItemText(htext, options['type']) d.SetDialogDefaultItem(OD_OK_ITEM) d.SetDialogCancelItem(OD_CANCEL_ITEM) while 1: for name in opt_dialog_dict.keys(): num = opt_dialog_dict[name] - tp, h, rect = d.GetDialogItem(num) - h.as_Control().SetControlValue(options[name]) + ctl = d.GetDialogItemAsControl(num) + ctl.SetControlValue(options[name]) n = ModalDialog(None) if n == OD_OK_ITEM: - tp, h, rect = d.GetDialogItem(OD_CREATOR_ITEM) - ncreator = GetDialogItemText(h) - tp, h, rect = d.GetDialogItem(OD_TYPE_ITEM) - ntype = GetDialogItemText(h) + htext = d.GetDialogItemAsControl(OD_CREATOR_ITEM) + ncreator = GetDialogItemText(htext) + htext = d.GetDialogItemAsControl(OD_TYPE_ITEM) + ntype = GetDialogItemText(htext) if len(ncreator) == 4 and len(ntype) == 4: options['creator'] = ncreator options['type'] = ntype @@ -107,11 +108,12 @@ def interact(options, title): except os.error: pass d = GetNewDialog(DIALOG_ID, -1) - tp, h, rect = d.GetDialogItem(TITLE_ITEM) - SetDialogItemText(h, title) - tp, h, rect = d.GetDialogItem(TEXT_ITEM) -## SetDialogItemText(h, string.joinfields(list, '\r')) - h.data = string.joinfields(options['path'], '\r') + htext = d.GetDialogItemAsControl(TITLE_ITEM) + SetDialogItemText(htext, title) + ctl = d.GetDialogItemAsControl(TEXT_ITEM) + data = string.joinfields(options['path'], '\r') + ctl.SetControlData(Controls.kControlEditTextPart, Controls.kControlEditTextTextTag, data) + d.SelectDialogItemText(TEXT_ITEM, 0, 32767) d.SelectDialogItemText(TEXT_ITEM, 0, 0) ## d.SetDialogDefaultItem(OK_ITEM) diff --git a/Mac/scripts/EditPythonPrefs.rsrc b/Mac/scripts/EditPythonPrefs.rsrc index 4644c5a25d518132d9200c04b975ec5f310302f4..e8452c44a6ebdd926b88d3346b69cdc8e9badad8 100644 GIT binary patch delta 1034 zcmexr`_gHG4U;1KL^~}mc`XJ8IUr`dyRm33_hwOnUp#^WA+8Z2B_$Ol3@Z!_EeshL zCd=}eGcrvM@M%I%k5l$)5NkXn&h!Zi6WPa#lM zKCeEIoX@)%NCxwHgV=nEK=L4;J&<` z#5fXJ4JX78ATn8;!JFX`L$q%xTMLjY!Jxws#@Nl6!XnJbzz9~x_>Y0XfD0^V$&kx9 zopA|^FfeH{Fo5i5{11@?DMh4Ow&IH^o<%?*8OC!Af=+%eK0x*)PiH@6AU!YGGs+c6 zuW}1=bpx8SEi<_oBz`V4ImZG>-vaVM^fMrB0;E3y#XGk7zZ|5`VvB17U+Bi20s7tywoCvqSWI2(xT*40OCrkeE>=AO&OIZCrPR@Hcjr3lxJj^yh75Q zF?I3>NlC`y$y`!}jOmkWr1TjTCa;m&3=~h0_6Dk1BdrJ|&q>=ewom4h31m#0oFF64 zs5iMnCKf1uO~z-lJkKwldI<(4h786A#`z44Knoc_fbl;Ag8>(iA;F--5XRWen8Luw z2$TB?NUl!0_# zuxFGjke-#{7Ub#%G<#WQaxq9^UuJTS1&}@k+ ze1Ogp3aBhG06JMKz|%PdNSg(R1Od%qbjnD{Ne9aNxrc7|1oG1+TPaj(|Njs4n)E85 zISh>d!0cmSHdvgu5h2dCd-6R6B}=}IFlhw_i8`3H0)u1%h^@g0HsTS8&F5d9ms+Gy Mlv