Up-Down control help

Function help:

Real API_Updown_Create (Real Parent Handle, Real X, Real Y, Real Width, Real Height, Real Style Flags, Real Extended Style Flags);

This function creates a new up-down control.

Argument list:
(0) Parent Handle: Identifies the window handle of the window to create this control on.
(1) X: The horizontal position of the control in pixels, relative to the parent window.
(2) Y: The vertical position of the control in pixels, relative to the parent window.
(3) Width: The horizontal size of the control in pixels.
(4) Height: The vertical size of the control in pixels.
(5) Style Flags: The style flags, supports the Global Control Styles and the following styles:

UDS_ALIGNLEFT
Positions the up-down control next to the left edge of the buddy window. The buddy window is moved to the right, and its width is decreased to accommodate the width of the up-down control.

UDS_ALIGNRIGHT
Positions the up-down control next to the right edge of the buddy window. The width of the buddy window is decreased to accommodate the width of the up-down control.

UDS_ARROWKEYS
Causes the up-down control to increment and decrement the position when the UP ARROW and DOWN ARROW keys are pressed.

UDS_AUTOBUDDY
Automatically selects the previous window in the z-order as the up-down control's buddy window.

UDS_HORZ
Causes the up-down control's arrows to point left and right instead of up and down.

UDS_HOTTRACK
Causes the control to exhibit "hot tracking" behavior. That is, it highlights the UP ARROW and DOWN ARROW on the control as the pointer passes over them. This style requires Microsoft Windows 98 or Windows 2000. If the system is running Windows 95 or Microsoft Windows NT 4.0, the flag is ignored. To check whether hot tracking is enabled, call SystemParametersInfo.

UDS_NOTHOUSANDS
Does not insert a thousands separator between every three decimal digits.

UDS_SETBUDDYINT
Causes the up-down control to set the text of the buddy windowwhen the position changes. The text consists of the position formatted as a decimal or hexadecimal string.

UDS_WRAP
Causes the position to "wrap" if it is incremented or decremented beyond the ending or beginning of the range.

Sorts strings in the list box alphabetically. The parent window receives an input message whenever the user clicks or double-clicks a string. The list box has borders on all sides.

Style flags can be separated by a bitwise or '|' operator.

(6) Extended Style Flags: This can be any combination of the Global Extended Control Styles.

Return value:
If this function succeeds, it returns the Control ID of the control, otherwise it returns 0.


Real API_Updown_GetBase ( Real Control ID)

Retrieves the current radix base (that is, either base 10 or 16) for an up-down control.

Return value:
Returns the current radix base.
Real API_Updown_GetBuddy ( Real Control ID)

This function returns the window handle of the current buddy.

Return value:
Returns the window handle.
Real API_Updown_GetPos ( Real Control ID)

Returns the current updown position.

Return value:
Returns the current updown position.
Real API_Updown_GetPos32 ( Real Control ID )

Returns the current updown position in a 32 bit value (allows you to use bigger values).

Return value:
Returns the current updown position.
Real API_Updown_GetRange ( Real Control ID , Real Range Type)

This function returns the range of an up-down control.

Range Types(argument1):

0: Return max part
1: Return min part

Return value:
Returns the range value.
Real API_Updown_GetRange32 ( Real Control ID , Real Range Type)

This function returns the 32 bits (allows you to use bigger values) range of an up-down control .

Range Types(argument1):

0: Return max part
1: Return min part

Return value:
Returns the 32 bits range value.

Real API_Updown_SetAccel ( Real Control ID, Real Number Of Accelerators, Real Acc 1 Time, Real Acc 1 Increase, Real Acc 2 Time, Real Acc 2 Increase, Real Acc 3 Time, Real Acc 3 Increase, Real Acc 4 Time, Real Acc 4 Increase)

This function changes the accelerators of the updown control.

The times are in seconds.

Return value:
Returns true (1) when succesful, or false (0) otherwise.


Real API_Updown_SetBase ( Real Control ID, Real Base)

Sets the radix base for an up-down control. The base value determines whether the buddy window displays numbers in decimal or hexadecimal digits. Hexadecimal numbers are always unsigned, and decimal numbers are signed.

Return value:
The return value is the previous base value. If an invalid base is given, the return value is zero (0).
Real API_Updown_SetBuddy ( Real Control ID, Real Buddy Control ID)

This function sets the buddy control.

Return value:
The return value is the window handle to the previous buddy window.
Real API_Updown_SetPos ( Real Control ID, Real Position)

This function sets the up-down position.

Return value:
The return value is the previous position.
Real API_Updown_SetPos32 ( Real Control ID, Real Position)

This function sets the 32 bits (allows you to use bigger values) up-down position.

Return value:
The return value is the previous position.
Real API_Updown_SetRange ( Real Control ID, Real Min,Real Max)

This function sets the up-down range.

Return value:
No return value.
Real API_Updown_SetRange32 ( Real Control ID, Real Min,Real Max)

This function sets the 32 bits (allows you to use bigger values) up-down range.

Return value:
No return value.

Secondary check commands for tree-views:

UDN_DELTAPOS - The position is about to change.

Example:

if ( Command == Updown1 ) // Updown1 sends a command
{
Second = API_Check_SecondaryCommand (1); // Check secondary command
if (Second == UDN_DELTAPOS) // Check message
{
show_message ("The position is about to change.");
}
}



Example code:

is
Updown1 = API_Updown_Create (Win,0,0,10,15,UDS_SETBUDDYINT|UDS_ARROWKEYS|UDS_ALIGNRIGHT);

API_Updown_SetBuddy (Updown1,Edit2); // Set Buddy
API_Updown_SetRange (Updown1,-100,100); // Set Range
API_Updown_SetBase (Updown1,16); // Set base

Return to help index