Igor Delovski Board Forum Index Igor Delovski Board
My Own Personal Slashdot!
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Controls

 
Post new topic   Reply to topic    Igor Delovski Board Forum Index -> Mac Carbon
Mac Carbon  
Author Message
delovski



Joined: 14 Jun 2006
Posts: 3523
Location: Zagreb

PostPosted: Tue Mar 27, 2007 12:56 am    Post subject: Controls Reply with quote

ADC: Technical Q&A QA1215,
Do I have to call CreateRootControl after creating my window?

"With the advent of Mac OS X 10.0 and 10.1, you no longer had to create
the root control yourself since the High Level Toolbox was doing it for you
automatically ... With the advent of Mac OS X 10.2, this API now matters
again."
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3523
Location: Zagreb

PostPosted: Thu Apr 12, 2007 12:01 am    Post subject: Reply with quote

ADC: Control Manager Reference

"The C-style, lowercase versions of Control Manager function names are no
longer supported. If your application uses any Control Manager lowercase
function names, you must replace them with their uppercase equivalents."
Back to top
View user's profile Send private message Visit poster's website
Ike
Kapetan


Joined: 17 Jun 2006
Posts: 3031
Location: Europe

PostPosted: Mon Apr 16, 2007 2:57 pm    Post subject: Reply with quote

ADC: SetAutomaticControlDragTrackingEnabledForWindow

"Earlier versions of system software enabled automatic drag tracking by
default, but as of Mac OS X v10.1.3, Mac OS 9.2, and CarbonLib 1.4, you
must call this function to enable automatic drag tracking."
Back to top
View user's profile Send private message
Ike
Kapetan


Joined: 17 Jun 2006
Posts: 3031
Location: Europe

PostPosted: Thu May 17, 2007 5:48 pm    Post subject: Reply with quote

ADC: TN2074 - HIView APIs vs. Control Manager APIs

"Starting with Mac OS X 10.2, aka Jaguar, a new set of APIs has been
introduced to deal with all the User Interface elements (menus, windows,
controls, etc.).

Although these APIs are C-based, they are object-oriented in the spirit,
and all the "classes" derive from the base class which is HIObject. HIView
is a class which is providing all the functionalities, and more, previously
offered by the Control Manager.

This technote will provide some clarification on the similar APIs and similar
behaviors and will be of interest to all the developers who wish to base their
program's User Interface on the new HIToolbox model."
Back to top
View user's profile Send private message
delovski



Joined: 14 Jun 2006
Posts: 3523
Location: Zagreb

PostPosted: Wed Oct 31, 2007 12:05 am    Post subject: Reply with quote

adc - CreateCheckBoxControl - Control Manager Reference

Code:
OSStatus CreateCheckBoxControl (
   WindowRef    window,
   const Rect  *boundsRect,
   CFStringRef  title,
   SInt32       initialValue,
   Boolean      autoToggle,
   ControlRef  *outControl
);


Last edited by delovski on Wed Oct 31, 2007 9:54 am; edited 3 times in total
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3523
Location: Zagreb

PostPosted: Wed Oct 31, 2007 12:06 am    Post subject: Reply with quote

adc - CreateIconControl - Control Manager Reference

Code:
OSStatus CreateIconControl (
   WindowRef   inWindow,
   const Rect *inBoundsRect,
   const ControlButtonContentInfo *inIconContent,
   Boolean     inDontTrack,
   ControlRef *outControl
);


Last edited by delovski on Wed Oct 31, 2007 9:55 am; edited 2 times in total
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3523
Location: Zagreb

PostPosted: Wed Oct 31, 2007 12:09 am    Post subject: Reply with quote

adc - CreatePictureControl - Control Manager Reference

Code:
OSStatus CreatePictureControl (
   WindowRef   window,
   const Rect *boundsRect,
   const ControlButtonContentInfo *content,
   Boolean     dontTrack,
   ControlRef *outControl
);


Last edited by delovski on Wed Oct 31, 2007 9:56 am; edited 2 times in total
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3523
Location: Zagreb

PostPosted: Wed Oct 31, 2007 12:12 am    Post subject: Reply with quote

adc - CreatePopupButtonControl - Control Manager Reference

Code:
OSStatus CreatePopupButtonControl (
   WindowRef   window,
   const Rect *boundsRect,
   CFStringRef title,
   MenuID      menuID,
   Boolean     variableWidth,
   SInt16      titleWidth,
   SInt16      titleJustification,
   Style       titleStyle,
   ControlRef *outControl
);


Last edited by delovski on Wed Oct 31, 2007 9:57 am; edited 2 times in total
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3523
Location: Zagreb

PostPosted: Wed Oct 31, 2007 12:14 am    Post subject: Reply with quote

adc - CreateProgressBarControl - Control Manager Reference

Code:
OSStatus CreateProgressBarControl (
   WindowRef   window,
   const Rect *boundsRect,
   SInt32      value,
   SInt32      minimum,
   SInt32      maximum,
   Boolean     indeterminate,
   ControlRef *outControl
);


Last edited by delovski on Wed Oct 31, 2007 9:58 am; edited 2 times in total
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3523
Location: Zagreb

PostPosted: Wed Oct 31, 2007 12:15 am    Post subject: Reply with quote

adc - CreatePushButtonControl - Control Manager Reference

Code:
OSStatus CreatePushButtonControl (
   WindowRef   window,
   const Rect *boundsRect,
   CFStringRef title,
   ControlRef *outControl
);


Last edited by delovski on Wed Oct 31, 2007 9:59 am; edited 2 times in total
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3523
Location: Zagreb

PostPosted: Wed Oct 31, 2007 12:16 am    Post subject: Reply with quote

adc - CreateRadioButtonControl - Control Manager Reference

Code:
OSStatus CreateRadioButtonControl (
   WindowRef   window,
   const Rect *boundsRect,
   CFStringRef title,
   SInt32      initialValue,
   Boolean     autoToggle,
   ControlRef *outControl
);


Last edited by delovski on Wed Oct 31, 2007 10:00 am; edited 2 times in total
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3523
Location: Zagreb

PostPosted: Wed Oct 31, 2007 12:17 am    Post subject: Reply with quote

adc - CreateScrollBarControl - Control Manager Reference

Code:
OSStatus CreateScrollBarControl (
   WindowRef   window,
   const Rect *boundsRect,
   SInt32      value,
   SInt32      minimum,
   SInt32      maximum,
   SInt32      viewSize,
   Boolean     liveTracking,
   ControlActionUPP liveTrackingProc,
   ControlRef *outControl
);


Last edited by delovski on Wed Oct 31, 2007 10:01 am; edited 2 times in total
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3523
Location: Zagreb

PostPosted: Wed Oct 31, 2007 12:18 am    Post subject: Reply with quote

adc - CreateStaticTextControl - Control Manager Reference

Code:
OSStatus CreateStaticTextControl (
   WindowRef   window,
   const Rect *boundsRect,
   CFStringRef text,
   const ControlFontStyleRec *style,
   ControlRef *outControl
);


Last edited by delovski on Wed Oct 31, 2007 10:02 am; edited 2 times in total
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3523
Location: Zagreb

PostPosted: Wed Oct 31, 2007 12:21 am    Post subject: Reply with quote

adc - CreateEditUnicodeTextControl() - Control Manager Reference

Code:
OSStatus CreateEditUnicodeTextControl (
   WindowRef     window,
   const Rect   *boundsRect,
   CFStringRef   text,
   Boolean       isPassword,
   const ControlFontStyleRec *style,
   ControlRef   *outControl
);
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3523
Location: Zagreb

PostPosted: Wed Oct 31, 2007 3:38 pm    Post subject: Reply with quote

adc - CreateListBoxControl - Control Manager Reference

Code:
OSStatus CreateListBoxControl (
   WindowRef   window,
   const Rect *boundsRect,
   Boolean     autoSize,
   SInt16      numRows,
   SInt16      numColumns,
   Boolean     horizScroll,
   Boolean     vertScroll,
   SInt16      cellHeight,
   SInt16      cellWidth,
   Boolean     hasGrowSpace,
   const ListDefSpec *listDef,
   ControlRef *outControl
);


See also: List Manager (pdf) & AppearanceSample>CustomList.cp

And: Lists and Custom List Definition Functions at MacTech!
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3523
Location: Zagreb

PostPosted: Thu Nov 01, 2007 11:41 pm    Post subject: Reply with quote

adc - ControlFontStyleRec - Control Manager Reference

Code:
struct ControlFontStyleRec {
   SInt16   flags;
   SInt16   font;
   SInt16   size;
   SInt16   style;
   SInt16   mode;
   SInt16   just;
   RGBColor foreColor;
   RGBColor backColor;
};
typedef struct ControlFontStyleRec ControlFontStyleRec;
typedef ControlFontStyleRec * ControlFontStylePtr;

*** just
If the kControlUseJustMask bit is set, then this field contains a value
specifying text justification. Possible values are teFlushDefault (0),
teCenter (1), teFlushRight (-1), and teFlushLeft (-2).


SetControlFontStyle - Control Manager Reference

Code:
OSErr SetControlFontStyle (
   ControlRef inControl,
   const ControlFontStyleRec *inStyle
);
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3523
Location: Zagreb

PostPosted: Fri Nov 02, 2007 4:33 pm    Post subject: Reply with quote

Control Font Style Flag Constants

Code:
enum {
   kControlUseFontMask = 0x0001,
   kControlUseFaceMask = 0x0002,
   kControlUseSizeMask = 0x0004,
   kControlUseForeColorMask = 0x0008,
   kControlUseBackColorMask = 0x0010,
   kControlUseModeMask = 0x0020,
   kControlUseJustMask = 0x0040,
   kControlUseAllMask = 0x00FF,
   kControlAddFontSizeMask = 0x0100
};
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3523
Location: Zagreb

PostPosted: Fri Nov 02, 2007 5:15 pm    Post subject: Reply with quote

adc - HandleControlKey - Control Manager Reference

Code:
ControlPartCode HandleControlKey (
   ControlRef     inControl,
   SInt16         inKeyCode,
   SInt16         inCharCode,
   EventModifiers inModifiers
);
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3523
Location: Zagreb

PostPosted: Fri Nov 02, 2007 5:21 pm    Post subject: Reply with quote

adc - HandleControlClick - Control Manager Reference

Code:
ControlPartCode HandleControlClick (
   ControlRef inControl,
   Point inWhere,
   EventModifiers inModifiers,
   ControlActionUPP inAction
);

"Call the HandleControlClick function after a call to FindControl() or
FindControlUnderMouse(). The HandleControlClick() function should be
called instead of TrackControl to follow the user’s cursor movements in
a control and provide visual feedback until the user releases the mouse
button."
Back to top
View user's profile Send private message Visit poster's website
Ike
Kapetan


Joined: 17 Jun 2006
Posts: 3031
Location: Europe

PostPosted: Tue Nov 06, 2007 3:48 pm    Post subject: Reply with quote

adc - KillControls() - Control Manager Reference

Code:
void KillControls (
   WindowRef theWindow
);

"The KillControls() function disposes of all controls associated with the
specified window. To remove just one control, use DisposeControl().

The Window Manager functions CloseWindow() and DisposeWindow() auto-
matically remove all controls associated with the window and release the
memory the controls occupy."
Back to top
View user's profile Send private message
Ike
Kapetan


Joined: 17 Jun 2006
Posts: 3031
Location: Europe

PostPosted: Tue Nov 06, 2007 3:53 pm    Post subject: Reply with quote

adc - DisposeControl() - Control Manager Reference

Code:
 void DisposeControl (
   ControlRef theControl
);

"Before destroying the control, DisposeControl() removes the control (and
any embedded controls it may possess) from the screen and deletes the
control from the window’s control list."
Back to top
View user's profile Send private message
Ike
Kapetan


Joined: 17 Jun 2006
Posts: 3031
Location: Europe

PostPosted: Sun Nov 18, 2007 7:19 pm    Post subject: Reply with quote

Push Button Control Data Tag Constants
Code:
enum {
   kControlPushButtonDefaultTag = 'dflt',
   kControlPushButtonCancelTag = 'cncl'
};

"... Control Manager defines this new control data tag constant. This constant
is passed in the inTagName parameters of the functions SetControlData and
GetControlData to specify the piece of data in a control that you wish to set
or get. You can also pass this constant in the inTagName parameter of the
function GetControlDataSize if you wish to determine the size of variable-
length control data."
Back to top
View user's profile Send private message
XNote
Kapetan


Joined: 16 Jun 2006
Posts: 532

PostPosted: Mon Nov 19, 2007 5:16 pm    Post subject: Reply with quote

adc - Introduction to HIView Programming Guide

"HIView is an object-oriented view system for implementing Carbon user
interface elements. HIView Programming Guide explains the concepts behind
the HIView model, covering the view embedding hierarchy, composited draw-
ing, and the new drawing coordinate system."
Back to top
View user's profile Send private message
Ike
Kapetan


Joined: 17 Jun 2006
Posts: 3031
Location: Europe

PostPosted: Mon Apr 21, 2008 2:27 pm    Post subject: Reply with quote

macKB.com - TextEdit key filtering...

"Per suggestions found elsewhere, I have implemented procs using
NewControlKeyFilterUPP() and NewControlEditTextValidationUPP(), and
they work just fine.

But what I am pulling my hair out on is how to get the <return> key!"
Back to top
View user's profile Send private message
delovski



Joined: 14 Jun 2006
Posts: 3523
Location: Zagreb

PostPosted: Mon Apr 21, 2008 9:08 pm    Post subject: Reply with quote

theList - Edit Text Control change notification answer (long)

"Given an edit text control in a window, how do you know when it's value
has changed, using Carbon Events?"
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3523
Location: Zagreb

PostPosted: Mon Apr 21, 2008 9:58 pm    Post subject: Reply with quote

theList - Re: edit unicode text control

"In our wrapper for edit fields, we need to do some preprocessing of text
input. If the character is allowed, we call HandleControlKey, giving it the
ASCII equivalent of the chararcter, the keyCode, and the modifiers."
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3523
Location: Zagreb

PostPosted: Wed May 07, 2008 12:14 am    Post subject: Reply with quote

theList - Edit text with no border

"Does anyone know how I can get rid of the edit text border/frame after
creation?"


theList - Modifying text using kEventRawKeyDown

"So currently, I call: GetEventParameter()"
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3523
Location: Zagreb

PostPosted: Sat May 24, 2008 2:44 pm    Post subject: Reply with quote

adc - DrawThemeEditTextFrame - Deprecated Appearance Manager Functions

Code:
OSStatus DrawThemeEditTextFrame (
   const Rect    *inRect,
   ThemeDrawState inState
);

"The frame is a maximum of 2 pixels thick and is drawn outside the specified
rectangle. ... A value of type ThemeDrawState - see Theme Drawing States.
You should pass the same rectangle you use with DrawThemeEditTextFrame()
function to the function DrawThemeFocusRect()."
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3523
Location: Zagreb

PostPosted: Thu Jun 05, 2008 8:24 pm    Post subject: Reply with quote

adc - DrawThemeSeparator - Deprecated Appearance Manager Functions

Code:
OSStatus DrawThemeSeparator (
   const Rect    *inRect,
   ThemeDrawState inState
);

"The orientation of the rectangle determines where the separator line is
drawn. If the rectangle is wider than it is tall, the separator line is horizontal;
otherwise it is vertical. The separator line can be drawn as active or inactive."


Last edited by delovski on Thu Jun 05, 2008 8:28 pm; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3523
Location: Zagreb

PostPosted: Thu Jun 05, 2008 8:27 pm    Post subject: Reply with quote

adc - DrawThemePrimaryGroup - Deprecated Appearance Manager Functions

Code:
OSStatus DrawThemePrimaryGroup (
   const Rect    *inRect,
   ThemeDrawState inState
);

"The DrawThemePrimaryGroup function draws a theme-compliant primary
group box frame. The primary group box frame is drawn inside the specified
rectangle and is a maximum of 2 pixels thick."

Code:
 enum {
   kThemeStateInactive = 0,
   kThemeStateActive = 1,
   kThemeStatePressed = 2,
   kThemeStateRollover = 6,
   kThemeStateUnavailable = 7,
   kThemeStateUnavailableInactive = 8,
   kThemeStatePressedUp = 2,
   kThemeStatePressedDown = 3
};
typedef UInt32 ThemeDrawState;
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3523
Location: Zagreb

PostPosted: Wed Jun 11, 2008 4:43 pm    Post subject: Reply with quote

adc - CreatePlacardControl() - Control Manager Reference

Code:
OSStatus CreatePlacardControl (
   WindowRef window,
   const Rect *boundsRect,
   ControlRef *outControl
);
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3523
Location: Zagreb

PostPosted: Sat Sep 20, 2008 11:12 pm    Post subject: Reply with quote

Something I've learned the hard way - you can't mix SetOrigin() with Control
Manager calls. Sometimes SetOrigin() affects contol's positioning, sometimes
it doesn't.

theList - default button problem

"I belatedly realized that SetDefaultButton won't work on OSX. Searched the
carbondev archive and found out that SetOrigin is no longer supported on OSX
making the button throbbing and gristling at the wrong place. it is a shocking
news to me."
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3523
Location: Zagreb

PostPosted: Mon Mar 20, 2017 3:59 pm    Post subject: Reply with quote

blezek/marathon-ios - carbon_widgets.cpp + carbon_widgets.h

"OS fork of AlephOne, the open source engine for Bungie's Marathon."
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Igor Delovski Board Forum Index -> Mac Carbon All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Delovski.hr
Powered by php-B.B. © 2001, 2005 php-B.B. Group