cdk_dscale(3)

✨ NAME ✨

cdk_dscale β€” Cdk scale widget (type double) πŸ’–

so like, this is the manual page for cdk_dscale(3), the Cdk scale widget where the value type is double. It's lowkey iconic, highkey useful. πŸ¦‹


🌸 SYNOPSIS 🌸

okay so here's the whole vibe ✨ β€” compile, include, and all the function signatures, exactly as they are: πŸ’–

       cc [ flag ... ] file ...  -lcdk [ library ... ]

       #include <cdk.h>

       double activateCDKDScale (
                      CDKDSCALE *scale,
                      chtype *actions);

       void destroyCDKDScale (
                      CDKDSCALE *scale);

       void drawCDKDScale (
                      CDKDSCALE *scale,
                      boolean box);

       void eraseCDKDScale (
                      CDKDSCALE *scale);

       boolean getCDKDScaleBox (
                      CDKDSCALE *scale);

       int getCDKDScaleDigits (
                      CDKDSCALE *scale);

       double getCDKDScaleHighValue (
                      CDKDSCALE *scale);

       double getCDKDScaleLowValue (
                      CDKDSCALE *scale);

       double getCDKDScaleValue (
                      CDKDSCALE *scale);

       int injectCDKDScale (
                      CDKDSCALE *scale,
                      chtype input);

       void moveCDKDScale (
                      CDKDSCALE *scale,
                      int xpos,
                      int ypos,
                      boolean relative,
                      boolean refresh);

       CDKDSCALE *newCDKDScale (
                      CDKSCREEN *cdkscreen,
                      int xpos,
                      int ypos,
                      const char *title,
                      const char *label,
                      chtype fieldAttribute,
                      int fieldWidth,
                      double currentValue,
                      double lowValue,
                      double highValue,
                      double increment,
                      double fastIncrement,
                      int digits,
                      boolean box,
                      boolean shadow);

       void positionCDKDScale (
                      CDKDSCALE *scale);

       void setCDKDScale (
                      CDKDSCALE *scale,
                      double lowValue,
                      double highValue,
                      double currentValue,
                      boolean box);

       void setCDKDScaleBackgroundAttrib (
                      CDKDSCALE *scale,
                      chtype attribute);

       void setCDKDScaleBackgroundColor (
                      CDKDSCALE *scale,
                      const char * color);

       void setCDKDScaleBox (
                      CDKDSCALE *scale,
                      boolean box);

       void setCDKDScaleBoxAttribute (
                      CDKDSCALE *scale,
                      chtype character);

       void setCDKDScaleDigits (
                      CDKDSCALE *scale,
                      int digits);

       void setCDKDScaleHorizontalChar (
                      CDKDSCALE *scale,
                      chtype character);

       void setCDKDScaleLLChar (
                      CDKDSCALE *scale,
                      chtype character);

       void setCDKDScaleLRChar (
                      CDKDSCALE *scale,
                      chtype character);

       void setCDKDScaleLowHigh (
                      CDKDSCALE *scale,
                      double low,
                      double high);

       void setCDKDScalePostProcess (
                      CDKDSCALE *scale,
                      PROCESSFN callback,
                      void * data);

       void setCDKDScalePreProcess (
                      CDKDSCALE *scale,
                      PROCESSFN callback,
                      void * data);

       void setCDKDScaleULChar (
                      CDKDSCALE *scale,
                      chtype character);

       void setCDKDScaleURChar (
                      CDKDSCALE *scale,
                      chtype character);

       void setCDKDScaleValue (
                      CDKDSCALE *scale,
                      double value);

       void setCDKDScaleVerticalChar (
                      CDKDSCALE *scale,
                      chtype character);

πŸ¦‹ DESCRIPTION πŸ¦‹

The Cdk scale widget? It creates a scale box with a label and a scale field. πŸ’… And the functions up there? They create or manipulate the Cdk scale box widget. That's the tea. β˜•

✨ AVAILABLE FUNCTIONS ✨

okay bestie, this is the whole roster, every single one of them, no skips πŸ’…


πŸ’– activateCDKDScale

wakes the scale widget up and lets your user actually, like, interact with it 🫢

  • the scale parameter is a pointer to a non-NULL scale widget.
  • if the actions parameter gets passed with a non-NULL value, the characters in the array are injected straight into the widget.

if you want to activate it interactively, pass in a NULL pointer for actions ✨

if the character entered into this widget is RETURN or TAB, then this function returns a value from the low value to the high value. it also sets the widget data exitType to vNORMAL. πŸ‘‘

if the character entered into this widget was ESCAPE, then the widget returns the unknownDouble value (peep the cdk_objs.h header file).

the widget data exitType will be set to vESCAPE_HIT.


πŸ’€ destroyCDKDScale

removes the widget from the screen and frees the memory the object used. gone. deleted. no crumbs. 😭


πŸŽ€ drawCDKDScale

draws the scale widget on the screen πŸ–οΈ

if the box parameter is true, the widget gets drawn with a box around it.


πŸ¦‹ eraseCDKDScale

removes the widget from the screen. but like, gently. this does NOT destroy the widget 🫣


🌸 getCDKDScaleBox

returns whether the widget will be drawn with a box around it.


⭐ getCDKDScaleDigits

returns the number of digits shown after the decimal point for the box value.


πŸ”₯ getCDKDScaleHighValue

returns the high value of the scale widget.


🌈 getCDKDScaleLowValue

returns the low value of the scale widget.


πŸ‘‘ getCDKDScaleValue

returns the current value of the widget. the moment. the now. ✨


πŸ’œ injectCDKDScale

injects a single character into the widget 🫢

  • the scale parameter is a pointer to a non-NULL scale widget.
  • the character parameter is the character to inject into the widget.

the return value and the side-effect (setting the widget data exitType) depend on which character you injected, so pay attention bestie:

  • RETURN or TAB β€” the function returns a value ranging from the scale's low value to the scale's high value. the widget data exitType is set to vNORMAL.
  • ESCAPE β€” the function returns the unknownDouble value (peep the cdk_objs.h header file). the widget data exitType is set to vESCAPE_HIT.
  • Otherwise β€” unless it gets modified by preprocessing, postprocessing or key bindings, the function returns the unknownDouble value (peep the cdk_objs.h header file). the widget data exitType is set to vEARLY_EXIT.

🧚 moveCDKDScale

moves the given widget to the given position 🚚

  • the xpos and ypos parameters are the new position of the widget.

the xpos parameter may be an integer or one of the pre-defined values TOP, BOTTOM, and CENTER.

the ypos parameter may be an integer or one of the pre-defined values LEFT, RIGHT, and CENTER.

  • the relative parameter states whether the xpos/ypos pair is a relative move or an absolute move.

for example, if xpos = 1 and ypos = 2 and relative = TRUE, then the widget would move one row down and two columns right. if the value of relative was FALSE, then the widget would move to the position (1,2).

do not use the values TOP, BOTTOM, LEFT, RIGHT, or CENTER when relative = TRUE. (weird things may happen). 😭

the final parameter refresh is a boolean value which states whether the widget will get refreshed after the move.


πŸ“ newCDKDScale

creates a pointer to a scale widget πŸŽ‰ parameters incoming:

  • screen β€” is the screen you wish this widget to be placed in.
  • xpos β€” controls the placement of the object along the horizontal axis. it may be an integer or one of the pre-defined values LEFT, RIGHT, and CENTER.
  • ypos β€” controls the placement of the object along the vertical axis. it may be an integer or one of the pre-defined values TOP, BOTTOM, and CENTER.
  • title β€” is the string to display at the top of the widget. the title can be more than one line; just provide a carriage return character at the line break.
  • label β€” is the string to display in the label of the scale field.
  • fieldAttribute β€” is the attribute of the characters displayed in the field.
  • fieldWidth β€” controls the width of the widget. if you provide a value of zero the widget will be created with the full width of the screen. if you provide a negative value, the widget will be created the full width minus the value provided.
  • currentValue β€” is the value of the scale field when the widget is activated.
  • lowValue and
  • highValue β€” are the low and high values of the widget respectively.
  • increment β€” is the regular increment value
  • fastIncrement β€” is the accelerated increment value.
  • box β€” is true if the widget should be drawn with a box around it.
  • shadow β€” turns the shadow on or off around this widget.

if the widget could not be created then a NULL pointer is returned.


🫢 positionCDKDScale

allows the user to move the widget around the screen via the cursor/keypad keys. peep cdk_position (3) for the key bindings πŸ”‘


🌟 setCDKDScale

lets the programmer modify certain elements of an existing scale widget.

the parameter names correspond to the same parameter names listed in the newCDKDScale function.


πŸ’… setCDKDScaleBackgroundAttrib

sets the background attribute of the widget.

the attribute parameter is a curses attribute, e.g., A_BOLD.


🎨 setCDKDScaleBackgroundColor

sets the background color of the widget.

the color parameter is in the format of the Cdk format strings.

peep cdk_display (3).


πŸ“¦ setCDKDScaleBox

sets whether the widget will be drawn with a box around it.


✨ setCDKDScaleBoxAttribute

sets the attribute of the box.


πŸ”’ setCDKDScaleDigits

sets the number of digits shown after the decimal point for the box value.


βž– setCDKDScaleHorizontalChar

sets the horizontal drawing character for the box to the given character.


πŸ“ setCDKDScaleLLChar

sets the lower left hand corner of the widget's box to the given character.


πŸ“ setCDKDScaleLRChar

sets the lower right hand corner of the widget's box to the given character.


🎚️ setCDKDScaleLowHigh

sets the low and high values of the widget.


πŸŒ€ setCDKDScalePostProcess

allows the user to have the widget call a function after the key has been applied to the widget.

  • the function parameter is the callback function.
  • the data parameter points to data passed to the callback function.

to learn more about post-processing peep cdk_process (3).


πŸŒ€ setCDKDScalePreProcess

allows the user to have the widget call a function after a key is hit and before the key is applied to the widget.

  • the function parameter is the callback function.
  • the data parameter points to data passed to the callback function.

to learn more about pre-processing peep cdk_process (3).


πŸ“ setCDKDScaleULChar

sets the upper left hand corner of the widget's box to the given character.


πŸ“ setCDKDScaleURChar

sets the upper right hand corner of the widget's box to the given character.


πŸ’« setCDKDScaleValue

sets the current value of the widget.


βž• setCDKDScaleVerticalChar

sets the vertical drawing character for the box to the given character.

✨ KEY BINDINGS ✨

okay so when the widget is activated, there are several default key bindings that help you enter or manipulate the info quickly. here's the whole keymap, bestie β€” no cap. πŸ’…

  • Down Arrow β€” decrements the scale by the normal value.
  • Up Arrow β€” increments the scale by the normal value.
  • u β€” increments the scale by the normal value.
  • Prev Page β€” decrements the scale by the accelerated value.
  • U β€” decrements the scale by the accelerated value.
  • Ctrl-B β€” decrements the scale by the accelerated value.
  • Next Page β€” increments the scale by the accelerated value.
  • Ctrl-F β€” increments the scale by the accelerated value.
  • Home β€” sets the scale to the low value.
  • g β€” sets the scale to the low value.
  • ^ β€” sets the scale to the low value.
  • End β€” sets the scale to the high value.
  • G β€” sets the scale to the high value.
  • $ β€” sets the scale to the high value.
  • Return β€” exits the widget and returns the index of the selected value. this also sets the widget data exitType to vNORMAL.
  • Tab β€” exits the widget and returns the index of the selected value. this also sets the widget data exitType to vNORMAL.
  • Escape β€” exits the widget and returns the unknownDouble value (see the cdk_objs.h header file). this also sets the widget data exitType to vESCAPE_HIT.
  • Ctrl-R β€” refreshes the screen.

if the cursor is not pointing to the field's value, the following key bindings apply. you may use the left/right arrows to move the cursor onto the field's value and modify it by typing characters to replace the digits and sign. πŸ‘€

  • Left Arrow β€” decrements the scale by the normal value.
  • Right Arrow β€” increments the scale by the normal value.
  • d β€” decrements the scale by the normal value.
  • D β€” increments the scale by the accelerated value.
  • - β€” decrements the scale by the normal value.
  • + β€” increments the scale by the normal value.
  • 0 β€” sets the scale to the low value.

πŸ‘€ SEE ALSO πŸ‘€


that's the whole vibe, bestie 🫢 β€” this page is cdk_dscale(3), dated 2025-10-13. stay slay. πŸ’–