Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Extra edit box gets displayed in dialog window created from resources!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Extra edit box gets displayed in dialog window created from resources!




On May 23, 2007, at 5:23 AM, Shrinidhi Karanth wrote:


Thanks a lot to everyone. I not only got rid of the extra text box from my dialog UI but also learnt few things :)

If you could have dictated back then that no
TEHandle to be used,
your editable fields wouldn't work. The point I want
to make is that
you shouldn't even ask this kind of question.
Instead of asking how
to do some low level hack you think you need to
address something,
you should ask for the best way to address the
higher level problem.

I meant how to get the extra non-unicode text box out of my UI. In my dialog UI I used to get 2 blinking cursors, one for the Unicode text and another of the shared field editor ( as Mr. Kusterer pointed out).

Actually, what you *should* want to know is the best way to create a dialog with Edit Unicode Text controls and what you're doing isn't the best way.


Now all I have to do is to just deactivate the
TEHandle for my dialog box as follows...
-----------------------------------------------------
	TEHandle teHandle =
GetDialogTextEditHandle(dialogRef) ;
	TEDeactivate ( teHandle );
-----------------------------------------------------

Apparently you haven't learned enough, as you don't need to do this. As I said previously, you can create the dialog with Edit Unicode Text controls initially, in which case you don't need to replace anything.



- Why are you replacing static text controls? There aren't two versions of static text controls. The static text control created when the dialog is created supports Unicode text.


The reason I have to replace the static text resource item with static text control is that static text resource item cannot be updated using CFString as they can be used with SetDialogItemText() which doesn't accept unicode characters.

A static text item *is* a static text control in Mac OS X. GetDialogItemAsControl will give you a ControlRef to a static text control, which you *can* set with a CFStringRef.


The problem here is not that I don't understand what you're trying to do. I used to have lots of Dialog Manager dialogs with static and editable text that had to function in Mac OS 9 and in Mac OS X. The problem here is that you don't understand enough about how Dialog Manager dialogs to understand what I'm telling you and realize:

- You don't need to replace the static text items.

- You only need to use the old edit text items if you're supporting Mac OS 9. Otherwise you can just set up the 'DITL' to use an Edit Unicode Text item. From ControlDefinitions.h:

enum {
  kControlEditUnicodeTextProc   = 912,
  kControlEditUnicodeTextPasswordProc = 914
};

Larry


Thanks again for the inputs. Shri

--- Laurence Harris <email@hidden> wrote:


On May 22, 2007, at 7:21 AM, Shrinidhi Karanth wrote:

However, I cannot change my design to use
some compositing resources or not to use resources
at
all since it is tightly coupled with the rest of
the
project.

Well, this late in the game the whole project needs to come into the present. ;-)

Would like to know if there is anyway I can
turn off the shared field editor! Is there a way
to
dictate that no TEHandle to be used for my dialog
window?

Fortunately this question is not applicable in Mac OS X. However, if the common TEHandle *were* still being used, this question makes no sense. The thing you're asking if you can turn off is the mechanism the Dialog Manager used to handle editable text fields in a dialog. If you could have dictated back then that no TEHandle to be used, your editable fields wouldn't work. The point I want to make is that you shouldn't even ask this kind of question. Instead of asking how to do some low level hack you think you need to address something, you should ask for the best way to address the higher level problem. The two best answers are:

- Switch to nibs.

- Define the text fields with 'CNTL' resources using
the appropriate
proc ID for an Edit Unicode Text control.

Larry
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Re: Extra edit box gets displayed in dialog window created from resources! (From: Shrinidhi Karanth <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.