The NcDialog API — Dialog-based console applications (C++)

These are actual screen captures of an NcDialog API application, running in a console window. Screenshots incorporate both the displayed text and the associated color attributes.

Screenshots were captured from GNOME Terminal, version 3.38.3 (16-color) configured to use the terminal definition's "Linux Console" color scheme. The HTML colors are a close approximation of the actual colors displayed in the terminal window.
CSS style definitions for color attributes and formatting are located in 'screenshot-styles.css'.

The dialog used in this example contains thirteen (14) user-interface controls:

  Control Type       Number      Control Function                 
Pushbutton one (1)perform the specified action
Radiobutton three (3)binary choice (yes/no, on/off)
Textbox two (2)enter text data (optionally filtered)
Billboard one (1)display a message stream (read only)
Scrollbox one (1)select an item from a scrolling list (static data)
Scrollext one (1)select an item from a scrolling list (dynamic data)
Dropdown one (1)select an item from an expanding list
Spinner one (1)select a numeric value within a predefined range
Slider one (1)select a graphical representation of a numeric value
Menuwin two (2)multi-level menuing system

For each capture, the user-interface control object which has the input focus is in   Red  .

In the first screenshot, the 'Done' Pushbutton control has the input focus.
The Radiobutton control group indicates that the static test messages written directly into the dialog window are to be displayed as 'Yellow Messages'.
The Dropdown control and the Menuwin controls are in the 'collapsed' state.

The input focus can be moved from one control to another using the 'TAB' / 'SHIFT+TAB' keys, →↑↓← arrow keys, OR by selecting a control via its optional 'Hotkey'. The control's Hotkey is designated by the underlined character in its title. For instance the 'Done' pushbutton's Hotkey is the 'D' character:   DONE  
N c D i a l o g - C a p t u r e D i a l o g w i t h C o n t r o l s
W r i t e a m e s s a g e : M u l t i - L i n e T e x t B o x ( a l l p r i n t i n g c h a r s ) B i l l b o a r d C o n t r o l ( r e a d o n l y )
H e r e ' s l o o k i n ' a t y o u , K i d ! I l s a , I ' m n o g o o d a t b e i n g n o b l e , b u t T h e r e o n c e w a s a m a n f r o m P o u g h k e e p s i e
i t d o e s n ' t t a k e m u c h t o s e e t h a t t h e W h o o f t e n g o t r a t h e r t i p s y .
[ ] G r e e n M e s s a g e s p r o b l e m s o f t h r e e l i t t l e p e o p l e d o n ' t H e w a s r o u n d l y a s h a m e d ;
[ ] M a g e n t a M e s s a g e s a m o u n t t o a h i l l o f b e a n s i n t h i s c r a z y T w a s h i s w i f e t h a t h e b l a m e d ,
[ ] Y e l l o w M e s s a g e s w o r l d . S o m e d a y y o u ' l l u n d e r s t a n d t h a t . F o r s h e w a s q u i t e p r o n e t o b e d i t z y .
Y o u r T e x t M e s s a g e : H e r e ' s l o o k i n ' a t y o u , K i d !
P r e s i d e n t i a l A p p r o v a l R a t i n g 2 ± D r i n k S i z e
Y o u r R e a l O p i n i o n : A b o u t w h a t w e ' v e c o m e t o e x p e c t . 3 2 O u n c e s
A v i a n s M a m m a l s
g o o s e c o w g o o s e
c h i c k e n h o r s e
d u c k s h e e p D r o p d o w n C o n t r o l
p i g e o n h o g
s p a r r r o w g o a t T o d a y ' s S p e c i a l s W h a t ' s F o r L u n c h ?
m a g p i e r a b b i t M e n u w i n C o n t r o l b a k e d f i s h - a n d - b e e r
r o b i n m o o s e
d o v e m o u s e F l y i n g C r i t t e r s : P i g e o n s c o o
S c r o l l b o x C o n t r o l S c r o l l e x t C o n t r o l W a l k i n g C r i t t e r s : S h e e p b a a a
Z o o C r i t t e r s : G e e s e h o n k
C a p t u r e D i a l o g T o F i l e
D O N E A L T + z = = p l a i n t e x t
A L T + S H I F T + z = = h t m l

In the next screenshot, we look at the group of Radiobuttons which determine the color of the messages written directly into the dialog window. This is an XOR (Exclusive-OR) group of controls. This means that exactly one member of the group may be selected. In this case the 'Magenta Messages' Radiobutton has been selected, and the static messages have been changed from yellow to magenta.
N c D i a l o g - C a p t u r e D i a l o g w i t h C o n t r o l s
W r i t e a m e s s a g e : M u l t i - L i n e T e x t B o x ( a l l p r i n t i n g c h a r s ) B i l l b o a r d C o n t r o l ( r e a d o n l y )
H e r e ' s l o o k i n ' a t y o u , K i d ! I l s a , I ' m n o g o o d a t b e i n g n o b l e , b u t T h e r e o n c e w a s a m a n f r o m P o u g h k e e p s i e
i t d o e s n ' t t a k e m u c h t o s e e t h a t t h e W h o o f t e n g o t r a t h e r t i p s y .
[ ] G r e e n M e s s a g e s p r o b l e m s o f t h r e e l i t t l e p e o p l e d o n ' t H e w a s r o u n d l y a s h a m e d ;
[ ] M a g e n t a M e s s a g e s a m o u n t t o a h i l l o f b e a n s i n t h i s c r a z y T w a s h i s w i f e t h a t h e b l a m e d ,
[ ] Y e l l o w M e s s a g e s w o r l d . S o m e d a y y o u ' l l u n d e r s t a n d t h a t . F o r s h e w a s q u i t e p r o n e t o b e d i t z y .
Y o u r T e x t M e s s a g e : H e r e ' s l o o k i n ' a t y o u , K i d !
P r e s i d e n t i a l A p p r o v a l R a t i n g 2 ± D r i n k S i z e
Y o u r R e a l O p i n i o n : A b o u t w h a t w e ' v e c o m e t o e x p e c t . 3 2 O u n c e s
A v i a n s M a m m a l s
g o o s e c o w g o o s e
c h i c k e n h o r s e
d u c k s h e e p D r o p d o w n C o n t r o l
p i g e o n h o g
s p a r r r o w g o a t T o d a y ' s S p e c i a l s W h a t ' s F o r L u n c h ?
m a g p i e r a b b i t M e n u w i n C o n t r o l b a k e d f i s h - a n d - b e e r
r o b i n m o o s e
d o v e m o u s e F l y i n g C r i t t e r s : P i g e o n s c o o
S c r o l l b o x C o n t r o l S c r o l l e x t C o n t r o l W a l k i n g C r i t t e r s : S h e e p b a a a
Z o o C r i t t e r s : G e e s e h o n k
C a p t u r e D i a l o g T o F i l e
D O N E A L T + z = = p l a i n t e x t
A L T + S H I F T + z = = h t m l

In this screenshot, the input focus in on the one-line Textbox control in the upper left corner of the dialog. The cursor is on the second character of the field ('Y'). Note that the message is longer than the field, so not all of the text is visible. Regardless of the visible display area, one-line Textbox controls can contain up to 4096 bytes of UTF-8 data.
N c D i a l o g - C a p t u r e D i a l o g w i t h C o n t r o l s
W r i t e a m e s s a g e : M u l t i - L i n e T e x t B o x ( a l l p r i n t i n g c h a r s ) B i l l b o a r d C o n t r o l ( r e a d o n l y )
" Y o u c a n ' t a l w a y s g e t w h a t I l s a , I ' m n o g o o d a t b e i n g n o b l e , b u t T h e r e o n c e w a s a m a n f r o m P o u g h k e e p s i e
i t d o e s n ' t t a k e m u c h t o s e e t h a t t h e W h o o f t e n g o t r a t h e r t i p s y .
[ ] G r e e n M e s s a g e s p r o b l e m s o f t h r e e l i t t l e p e o p l e d o n ' t H e w a s r o u n d l y a s h a m e d ;
[ ] M a g e n t a M e s s a g e s a m o u n t t o a h i l l o f b e a n s i n t h i s c r a z y T w a s h i s w i f e t h a t h e b l a m e d ,
[ ] Y e l l o w M e s s a g e s w o r l d . S o m e d a y y o u ' l l u n d e r s t a n d t h a t . F o r s h e w a s q u i t e p r o n e t o b e d i t z y .
Y o u r T e x t M e s s a g e : H e r e ' s l o o k i n ' a t y o u , K i d !
P r e s i d e n t i a l A p p r o v a l R a t i n g 2 ± D r i n k S i z e
Y o u r R e a l O p i n i o n : A b o u t w h a t w e ' v e c o m e t o e x p e c t . 3 2 O u n c e s
A v i a n s M a m m a l s
g o o s e c o w g o o s e
c h i c k e n h o r s e
d u c k s h e e p D r o p d o w n C o n t r o l
p i g e o n h o g
s p a r r r o w g o a t T o d a y ' s S p e c i a l s W h a t ' s F o r L u n c h ?
m a g p i e r a b b i t M e n u w i n C o n t r o l b a k e d f i s h - a n d - b e e r
r o b i n m o o s e
d o v e m o u s e F l y i n g C r i t t e r s : P i g e o n s c o o
S c r o l l b o x C o n t r o l S c r o l l e x t C o n t r o l W a l k i n g C r i t t e r s : S h e e p b a a a
Z o o C r i t t e r s : G e e s e h o n k
C a p t u r e D i a l o g T o F i l e
D O N E A L T + z = = p l a i n t e x t
A L T + S H I F T + z = = h t m l

In this screenshot, the multi-line Textbox control has input focus, and the cursor is positioned at the end of the text data. Again, the data are larger than the field, so not all the text is visible. Multi-line Textbox controls dynamically allocate space for text according to a formula based on the number of display rows/columns, up to approximately three times the number of bytes of displayed data, or 4096 bytes of UTF-8 text data, whichever is greater.


Note that the Billboard control to the right of the multi-line Textbox control is Read-only, and therefore cannot receive the input focus. A Billboard is very much like a Textbox control; however, it has several unique properties, such as the ability to programatically insert additional text of any color, which implements an auto-scroll effect for displaying often-updated user messages. A Billboard is typically under the control of a separate execution thread which is responsible for periodically updating the control's contents. Of course, this dynamic modification is not visible in a screenshot.

Please refer to the 'Dialog4' test application included with the NcDialog API package
    for examples of a Billboard control managed by a separate execution thread.

N c D i a l o g - C a p t u r e D i a l o g w i t h C o n t r o l s
W r i t e a m e s s a g e : M u l t i - L i n e T e x t B o x ( a l l p r i n t i n g c h a r s ) B i l l b o a r d C o n t r o l ( r e a d o n l y )
" Y o u c a n ' t a l w a y s g e t w h a t p r o b l e m s o f t h r e e l i t t l e p e o p l e d o n ' t T h e r e o n c e w a s a m a n f r o m P o u g h k e e p s i e
a m o u n t t o a h i l l o f b e a n s i n t h i s c r a z y W h o o f t e n g o t r a t h e r t i p s y .
[ ] G r e e n M e s s a g e s w o r l d . S o m e d a y y o u ' l l u n d e r s t a n d t h a t . H e w a s r o u n d l y a s h a m e d ;
[ ] M a g e n t a M e s s a g e s N o w , n o w . . . H e r e ' s l o o k i n g a t y o u , T w a s h i s w i f e t h a t h e b l a m e d ,
[ ] Y e l l o w M e s s a g e s k i d ! - - R i c k B l a i n e , C a s a b l a n c a ( 1 9 4 2 ) F o r s h e w a s q u i t e p r o n e t o b e d i t z y .
Y o u r T e x t M e s s a g e : " Y o u c a n ' t a l w a y s g e t w h a t y o u w a n t , b u t i f y o u t r y , s o m e t i m e s - - y o u g e t w h a t y o u n e e d . "
P r e s i d e n t i a l A p p r o v a l R a t i n g 2 ± D r i n k S i z e
Y o u r R e a l O p i n i o n : A b o u t w h a t w e ' v e c o m e t o e x p e c t . 3 2 O u n c e s
A v i a n s M a m m a l s
g o o s e c o w g o o s e
c h i c k e n h o r s e
d u c k s h e e p D r o p d o w n C o n t r o l
p i g e o n h o g
s p a r r r o w g o a t T o d a y ' s S p e c i a l s W h a t ' s F o r L u n c h ?
m a g p i e r a b b i t M e n u w i n C o n t r o l b a k e d f i s h - a n d - b e e r
r o b i n m o o s e
d o v e m o u s e F l y i n g C r i t t e r s : P i g e o n s c o o
S c r o l l b o x C o n t r o l S c r o l l e x t C o n t r o l W a l k i n g C r i t t e r s : S h e e p b a a a
Z o o C r i t t e r s : G e e s e h o n k
C a p t u r e D i a l o g T o F i l e
D O N E A L T + z = = p l a i n t e x t
A L T + S H I F T + z = = h t m l

Next, let's look at the Spinner control. This control is in the left-center of the dialog window. The Spinner is used to select a numeric value. Values may be either integers or decimal values. The user may scan up and down through the range of values by ones, by 10s, 100s or 1000s, plus Home and End.

In this case, the Spinner is configured for a range between '-1' and '10' and with an initial value of '2'. Each value is assigned to a different static display string. When the user has selected a new value ('5' in this example), then the static display string will be updated (see next screenshot).
N c D i a l o g - C a p t u r e D i a l o g w i t h C o n t r o l s
W r i t e a m e s s a g e : M u l t i - L i n e T e x t B o x ( a l l p r i n t i n g c h a r s ) B i l l b o a r d C o n t r o l ( r e a d o n l y )
" Y o u c a n ' t a l w a y s g e t w h a t I l s a , I ' m n o g o o d a t b e i n g n o b l e , b u t T h e r e o n c e w a s a m a n f r o m P o u g h k e e p s i e
i t d o e s n ' t t a k e m u c h t o s e e t h a t t h e W h o o f t e n g o t r a t h e r t i p s y .
[ ] G r e e n M e s s a g e s p r o b l e m s o f t h r e e l i t t l e p e o p l e d o n ' t H e w a s r o u n d l y a s h a m e d ;
[ ] M a g e n t a M e s s a g e s a m o u n t t o a h i l l o f b e a n s i n t h i s c r a z y T w a s h i s w i f e t h a t h e b l a m e d ,
[ ] Y e l l o w M e s s a g e s w o r l d . S o m e d a y y o u ' l l u n d e r s t a n d t h a t . F o r s h e w a s q u i t e p r o n e t o b e d i t z y .
Y o u r T e x t M e s s a g e : " Y o u c a n ' t a l w a y s g e t w h a t y o u w a n t , b u t i f y o u t r y , s o m e t i m e s - - y o u g e t w h a t y o u n e e d . "
P r e s i d e n t i a l A p p r o v a l R a t i n g 5 ± D r i n k S i z e
Y o u r R e a l O p i n i o n : A b o u t w h a t w e ' v e c o m e t o e x p e c t . 3 2 O u n c e s
A v i a n s M a m m a l s
g o o s e c o w g o o s e
c h i c k e n h o r s e
d u c k s h e e p D r o p d o w n C o n t r o l
p i g e o n h o g
s p a r r r o w g o a t T o d a y ' s S p e c i a l s W h a t ' s F o r L u n c h ?
m a g p i e r a b b i t M e n u w i n C o n t r o l b a k e d f i s h - a n d - b e e r
r o b i n m o o s e
d o v e m o u s e F l y i n g C r i t t e r s : P i g e o n s c o o
S c r o l l b o x C o n t r o l S c r o l l e x t C o n t r o l W a l k i n g C r i t t e r s : S h e e p b a a a
Z o o C r i t t e r s : G e e s e h o n k
C a p t u r e D i a l o g T o F i l e
D O N E A L T + z = = p l a i n t e x t
A L T + S H I F T + z = = h t m l

To the right of the Spinner control, near the center of the window, is a Slider control. The Slider is used to increase or decrease the magnitude of a numeric value which is represented by the height of the slider bar. The Slider value is adjusted using the Up-Arrow, Down-Arrow, Page-Up, Page-Down, Home and End keys or by using the mouse scroll-wheel.

In this case, the Slider is configured for a range between '6' and '64' and with an initial value of '32' ounces. The user adjusts the value by increasing or decreasing the height of the slider bar (see next screenshot).

Note that the static text associated with the Spinner control (previous screenshot) has been updated.
N c D i a l o g - C a p t u r e D i a l o g w i t h C o n t r o l s
W r i t e a m e s s a g e : M u l t i - L i n e T e x t B o x ( a l l p r i n t i n g c h a r s ) B i l l b o a r d C o n t r o l ( r e a d o n l y )
" Y o u c a n ' t a l w a y s g e t w h a t I l s a , I ' m n o g o o d a t b e i n g n o b l e , b u t T h e r e o n c e w a s a m a n f r o m P o u g h k e e p s i e
i t d o e s n ' t t a k e m u c h t o s e e t h a t t h e W h o o f t e n g o t r a t h e r t i p s y .
[ ] G r e e n M e s s a g e s p r o b l e m s o f t h r e e l i t t l e p e o p l e d o n ' t H e w a s r o u n d l y a s h a m e d ;
[ ] M a g e n t a M e s s a g e s a m o u n t t o a h i l l o f b e a n s i n t h i s c r a z y T w a s h i s w i f e t h a t h e b l a m e d ,
[ ] Y e l l o w M e s s a g e s w o r l d . S o m e d a y y o u ' l l u n d e r s t a n d t h a t . F o r s h e w a s q u i t e p r o n e t o b e d i t z y .
Y o u r T e x t M e s s a g e : " Y o u c a n ' t a l w a y s g e t w h a t y o u w a n t , b u t i f y o u t r y , s o m e t i m e s - - y o u g e t w h a t y o u n e e d . "
P r e s i d e n t i a l A p p r o v a l R a t i n g 5 ± D r i n k S i z e
Y o u r R e a l O p i n i o n : I g u e s s w e a r e l u c k i e r t h a n w e d e s e r v e . 3 2 O u n c e s
A v i a n s M a m m a l s
g o o s e c o w g o o s e
c h i c k e n h o r s e
d u c k s h e e p D r o p d o w n C o n t r o l
p i g e o n h o g
s p a r r r o w g o a t T o d a y ' s S p e c i a l s W h a t ' s F o r L u n c h ?
m a g p i e r a b b i t M e n u w i n C o n t r o l b a k e d f i s h - a n d - b e e r
r o b i n m o o s e
d o v e m o u s e F l y i n g C r i t t e r s : P i g e o n s c o o
S c r o l l b o x C o n t r o l S c r o l l e x t C o n t r o l W a l k i n g C r i t t e r s : S h e e p b a a a
Z o o C r i t t e r s : G e e s e h o n k
C a p t u r e D i a l o g T o F i l e
D O N E A L T + z = = p l a i n t e x t
A L T + S H I F T + z = = h t m l

Next, is the Scrollbox control on the left edge of the dialog. The current selection is highlighted. The user may select a new value by scrolling through the list. Note that the list is a static array of display items and may be of any reasonable length, with the number of items simultaneously displayed dictated by the specified dimensions of the control.

Note that the color of the static text has been changed to 'Green Messages' via the Radiobutton group.
N c D i a l o g - C a p t u r e D i a l o g w i t h C o n t r o l s
W r i t e a m e s s a g e : M u l t i - L i n e T e x t B o x ( a l l p r i n t i n g c h a r s ) B i l l b o a r d C o n t r o l ( r e a d o n l y )
" Y o u c a n ' t a l w a y s g e t w h a t I l s a , I ' m n o g o o d a t b e i n g n o b l e , b u t T h e r e o n c e w a s a m a n f r o m P o u g h k e e p s i e
i t d o e s n ' t t a k e m u c h t o s e e t h a t t h e W h o o f t e n g o t r a t h e r t i p s y .
[ ] G r e e n M e s s a g e s p r o b l e m s o f t h r e e l i t t l e p e o p l e d o n ' t H e w a s r o u n d l y a s h a m e d ;
[ ] M a g e n t a M e s s a g e s a m o u n t t o a h i l l o f b e a n s i n t h i s c r a z y T w a s h i s w i f e t h a t h e b l a m e d ,
[ ] Y e l l o w M e s s a g e s w o r l d . S o m e d a y y o u ' l l u n d e r s t a n d t h a t . F o r s h e w a s q u i t e p r o n e t o b e d i t z y .
Y o u r T e x t M e s s a g e : " Y o u c a n ' t a l w a y s g e t w h a t y o u w a n t , b u t i f y o u t r y , s o m e t i m e s - - y o u g e t w h a t y o u n e e d . "
P r e s i d e n t i a l A p p r o v a l R a t i n g 5 ± D r i n k S i z e
Y o u r R e a l O p i n i o n : I g u e s s w e a r e l u c k i e r t h a n w e d e s e r v e . 4 8 O u n c e s
A v i a n s M a m m a l s
g o o s e c o w g o o s e
c h i c k e n h o r s e
d u c k s h e e p D r o p d o w n C o n t r o l
p i g e o n h o g
s p a r r r o w g o a t T o d a y ' s S p e c i a l s W h a t ' s F o r L u n c h ?
m a g p i e r a b b i t M e n u w i n C o n t r o l b a k e d f i s h - a n d - b e e r
r o b i n m o o s e
d o v e m o u s e F l y i n g C r i t t e r s : P i g e o n s c o o
S c r o l l b o x C o n t r o l S c r o l l e x t C o n t r o l W a l k i n g C r i t t e r s : S h e e p b a a a
Z o o C r i t t e r s : G e e s e h o n k
C a p t u r e D i a l o g T o F i l e
D O N E A L T + z = = p l a i n t e x t
A L T + S H I F T + z = = h t m l

Next, is the Scrollext control. The current selection is highlighted. From the user's point of view, this control is functionally identical to the Scrollbox control (previous screenshot); however, the displayed data are External to the control itself, thus, Scrollext. Both the text and color data live in the application's memory space so that the data may be transparently updated by the application in response to changing needs.

See our 'FileMangler' file-management utility for a practical demonstration of the Scrollext control.

N c D i a l o g - C a p t u r e D i a l o g w i t h C o n t r o l s
W r i t e a m e s s a g e : M u l t i - L i n e T e x t B o x ( a l l p r i n t i n g c h a r s ) B i l l b o a r d C o n t r o l ( r e a d o n l y )
" Y o u c a n ' t a l w a y s g e t w h a t I l s a , I ' m n o g o o d a t b e i n g n o b l e , b u t T h e r e o n c e w a s a m a n f r o m P o u g h k e e p s i e
i t d o e s n ' t t a k e m u c h t o s e e t h a t t h e W h o o f t e n g o t r a t h e r t i p s y .
[ ] G r e e n M e s s a g e s p r o b l e m s o f t h r e e l i t t l e p e o p l e d o n ' t H e w a s r o u n d l y a s h a m e d ;
[ ] M a g e n t a M e s s a g e s a m o u n t t o a h i l l o f b e a n s i n t h i s c r a z y T w a s h i s w i f e t h a t h e b l a m e d ,
[ ] Y e l l o w M e s s a g e s w o r l d . S o m e d a y y o u ' l l u n d e r s t a n d t h a t . F o r s h e w a s q u i t e p r o n e t o b e d i t z y .
Y o u r T e x t M e s s a g e : " Y o u c a n ' t a l w a y s g e t w h a t y o u w a n t , b u t i f y o u t r y , s o m e t i m e s - - y o u g e t w h a t y o u n e e d . "
P r e s i d e n t i a l A p p r o v a l R a t i n g 5 ± D r i n k S i z e
Y o u r R e a l O p i n i o n : I g u e s s w e a r e l u c k i e r t h a n w e d e s e r v e . 4 8 O u n c e s
A v i a n s M a m m a l s
g o o s e c o w g o o s e
c h i c k e n h o r s e
d u c k s h e e p D r o p d o w n C o n t r o l
p i g e o n h o g
s p a r r r o w g o a t T o d a y ' s S p e c i a l s W h a t ' s F o r L u n c h ?
m a g p i e r a b b i t M e n u w i n C o n t r o l b a k e d f i s h - a n d - b e e r
r o b i n m o o s e
d o v e m o u s e F l y i n g C r i t t e r s : R o b i n s s i n g
S c r o l l b o x C o n t r o l S c r o l l e x t C o n t r o l W a l k i n g C r i t t e r s : S h e e p b a a a
Z o o C r i t t e r s : G e e s e h o n k
C a p t u r e D i a l o g T o F i l e
D O N E A L T + z = = p l a i n t e x t
A L T + S H I F T + z = = h t m l

The input focus is now on a Dropdown control, but note that the control has not yet been expanded. It simply displays the currently-selected item. When the user expands the control (see next screenshot), then a new item may be selected. The control is expanded when it receives either the 'Enter' key, the 'Spacebar' key or the 'PageDown' key.
N c D i a l o g - C a p t u r e D i a l o g w i t h C o n t r o l s
W r i t e a m e s s a g e : M u l t i - L i n e T e x t B o x ( a l l p r i n t i n g c h a r s ) B i l l b o a r d C o n t r o l ( r e a d o n l y )
" Y o u c a n ' t a l w a y s g e t w h a t I l s a , I ' m n o g o o d a t b e i n g n o b l e , b u t T h e r e o n c e w a s a m a n f r o m P o u g h k e e p s i e
i t d o e s n ' t t a k e m u c h t o s e e t h a t t h e W h o o f t e n g o t r a t h e r t i p s y .
[ ] G r e e n M e s s a g e s p r o b l e m s o f t h r e e l i t t l e p e o p l e d o n ' t H e w a s r o u n d l y a s h a m e d ;
[ ] M a g e n t a M e s s a g e s a m o u n t t o a h i l l o f b e a n s i n t h i s c r a z y T w a s h i s w i f e t h a t h e b l a m e d ,
[ ] Y e l l o w M e s s a g e s w o r l d . S o m e d a y y o u ' l l u n d e r s t a n d t h a t . F o r s h e w a s q u i t e p r o n e t o b e d i t z y .
Y o u r T e x t M e s s a g e : " Y o u c a n ' t a l w a y s g e t w h a t y o u w a n t , b u t i f y o u t r y , s o m e t i m e s - - y o u g e t w h a t y o u n e e d . "
P r e s i d e n t i a l A p p r o v a l R a t i n g 5 ± D r i n k S i z e
Y o u r R e a l O p i n i o n : I g u e s s w e a r e l u c k i e r t h a n w e d e s e r v e . 4 8 O u n c e s
A v i a n s M a m m a l s
g o o s e c o w g o o s e
c h i c k e n h o r s e
d u c k s h e e p D r o p d o w n C o n t r o l
p i g e o n h o g
s p a r r r o w g o a t T o d a y ' s S p e c i a l s W h a t ' s F o r L u n c h ?
m a g p i e r a b b i t M e n u w i n C o n t r o l b a k e d f i s h - a n d - b e e r
r o b i n m o o s e
d o v e m o u s e F l y i n g C r i t t e r s : R o b i n s s i n g
S c r o l l b o x C o n t r o l S c r o l l e x t C o n t r o l W a l k i n g C r i t t e r s : M o o s e b e l l o w
Z o o C r i t t e r s : G e e s e h o n k
C a p t u r e D i a l o g T o F i l e
D O N E A L T + z = = p l a i n t e x t
A L T + S H I F T + z = = h t m l

The input focus is now on the expanded Dropdown control. In this example, the control expands downward, but Dropdown controls may also be configured to expand upward, or to expand upward and downward from the centerpoint.

Note that dialog data which are obscured by expanding the control are automatically saved, so that when the control returns to the collapsed state, the obscured data will be restored.
N c D i a l o g - C a p t u r e D i a l o g w i t h C o n t r o l s
W r i t e a m e s s a g e : M u l t i - L i n e T e x t B o x ( a l l p r i n t i n g c h a r s ) B i l l b o a r d C o n t r o l ( r e a d o n l y )
" Y o u c a n ' t a l w a y s g e t w h a t I l s a , I ' m n o g o o d a t b e i n g n o b l e , b u t T h e r e o n c e w a s a m a n f r o m P o u g h k e e p s i e
i t d o e s n ' t t a k e m u c h t o s e e t h a t t h e W h o o f t e n g o t r a t h e r t i p s y .
[ ] G r e e n M e s s a g e s p r o b l e m s o f t h r e e l i t t l e p e o p l e d o n ' t H e w a s r o u n d l y a s h a m e d ;
[ ] M a g e n t a M e s s a g e s a m o u n t t o a h i l l o f b e a n s i n t h i s c r a z y T w a s h i s w i f e t h a t h e b l a m e d ,
[ ] Y e l l o w M e s s a g e s w o r l d . S o m e d a y y o u ' l l u n d e r s t a n d t h a t . F o r s h e w a s q u i t e p r o n e t o b e d i t z y .
Y o u r T e x t M e s s a g e : " Y o u c a n ' t a l w a y s g e t w h a t y o u w a n t , b u t i f y o u t r y , s o m e t i m e s - - y o u g e t w h a t y o u n e e d . "
P r e s i d e n t i a l A p p r o v a l R a t i n g 5 ± D r i n k S i z e
Y o u r R e a l O p i n i o n : I g u e s s w e a r e l u c k i e r t h a n w e d e s e r v e . 4 8 O u n c e s
A v i a n s M a m m a l s
g o o s e c o w g o o s e
c h i c k e n h o r s e c h i c k e n
d u c k s h e e p d u c k
p i g e o n h o g p i g e o n
s p a r r r o w g o a t s p a r r r o w W h a t ' s F o r L u n c h ?
m a g p i e r a b b i t m a g p i e b a k e d f i s h - a n d - b e e r
r o b i n m o o s e
d o v e m o u s e F l y i n g C r i t t e r s : R o b i n s s i n g
S c r o l l b o x C o n t r o l S c r o l l e x t C o n t r o l W a l k i n g C r i t t e r s : M o o s e b e l l o w
Z o o C r i t t e r s : G e e s e h o n k
C a p t u r e D i a l o g T o F i l e
D O N E A L T + z = = p l a i n t e x t
A L T + S H I F T + z = = h t m l

The input focus has now moved to the visible Menuwin control in the center of the dialog, which is currently in the 'collapsed' state, that is, only the menu's title is displayed.

Note that the Dropdown control (previous screenshot) has returned to its 'collapsed' state, displaying its new selection, and that the previously-obscured data have been restored.

At this point, the user may either open the menu or continue on to another control object without expanding the menu. See the next screenshot for the expanded Menuwin control.
N c D i a l o g - C a p t u r e D i a l o g w i t h C o n t r o l s
W r i t e a m e s s a g e : M u l t i - L i n e T e x t B o x ( a l l p r i n t i n g c h a r s ) B i l l b o a r d C o n t r o l ( r e a d o n l y )
" Y o u c a n ' t a l w a y s g e t w h a t I l s a , I ' m n o g o o d a t b e i n g n o b l e , b u t T h e r e o n c e w a s a m a n f r o m P o u g h k e e p s i e
i t d o e s n ' t t a k e m u c h t o s e e t h a t t h e W h o o f t e n g o t r a t h e r t i p s y .
[ ] G r e e n M e s s a g e s p r o b l e m s o f t h r e e l i t t l e p e o p l e d o n ' t H e w a s r o u n d l y a s h a m e d ;
[ ] M a g e n t a M e s s a g e s a m o u n t t o a h i l l o f b e a n s i n t h i s c r a z y T w a s h i s w i f e t h a t h e b l a m e d ,
[ ] Y e l l o w M e s s a g e s w o r l d . S o m e d a y y o u ' l l u n d e r s t a n d t h a t . F o r s h e w a s q u i t e p r o n e t o b e d i t z y .
Y o u r T e x t M e s s a g e : " Y o u c a n ' t a l w a y s g e t w h a t y o u w a n t , b u t i f y o u t r y , s o m e t i m e s - - y o u g e t w h a t y o u n e e d . "
P r e s i d e n t i a l A p p r o v a l R a t i n g 5 ± D r i n k S i z e
Y o u r R e a l O p i n i o n : I g u e s s w e a r e l u c k i e r t h a n w e d e s e r v e . 4 8 O u n c e s
A v i a n s M a m m a l s
g o o s e c o w c h i c k e n
c h i c k e n h o r s e
d u c k s h e e p D r o p d o w n C o n t r o l
p i g e o n h o g
s p a r r r o w g o a t T o d a y ' s S p e c i a l s W h a t ' s F o r L u n c h ?
m a g p i e r a b b i t M e n u w i n C o n t r o l b a k e d f i s h - a n d - b e e r
r o b i n m o o s e
d o v e m o u s e F l y i n g C r i t t e r s : R o b i n s s i n g
S c r o l l b o x C o n t r o l S c r o l l e x t C o n t r o l W a l k i n g C r i t t e r s : M o o s e b e l l o w
Z o o C r i t t e r s : C h i c k e n s c l u c k
C a p t u r e D i a l o g T o F i l e
D O N E A L T + z = = p l a i n t e x t
A L T + S H I F T + z = = h t m l

The Menuwin control has now been expanded to reveal the contents of the menu.
Note that data obscured by the menu expansion has been automatically saved and will be restored when the menu is closed.

The user may now select an item from the menu by pressing the 'Enter' or 'Spacebar' keys,
OR
may use the 'TAB' / "SHIFT+TAB' or 'Left' / 'Right' arrow keys to move on to another control without making a selection. Note that Hotkeys for other control objects are not available when inside an expanded Menuwin control because each item of a menu optionally has its own Hotkey (underlined character).

When the input focus shifts to another control, the Menuwin control returns to its collapsed state, and the previously-obscured data are restored.

Note, however, that Menuwin controls are often grouped, either as a 'Menu Bar' (menu sequence), or with attached sub-menus. Please see the next screenshot for an example.
N c D i a l o g - C a p t u r e D i a l o g w i t h C o n t r o l s
W r i t e a m e s s a g e : M u l t i - L i n e T e x t B o x ( a l l p r i n t i n g c h a r s ) B i l l b o a r d C o n t r o l ( r e a d o n l y )
" Y o u c a n ' t a l w a y s g e t w h a t I l s a , I ' m n o g o o d a t b e i n g n o b l e , b u t T h e r e o n c e w a s a m a n f r o m P o u g h k e e p s i e
i t d o e s n ' t t a k e m u c h t o s e e t h a t t h e W h o o f t e n g o t r a t h e r t i p s y .
[ ] G r e e n M e s s a g e s p r o b l e m s o f t h r e e l i t t l e p e o p l e d o n ' t H e w a s r o u n d l y a s h a m e d ;
[ ] M a g e n t a M e s s a g e s a m o u n t t o a h i l l o f b e a n s i n t h i s c r a z y T w a s h i s w i f e t h a t h e b l a m e d ,
[ ] Y e l l o w M e s s a g e s w o r l d . S o m e d a y y o u ' l l u n d e r s t a n d t h a t . F o r s h e w a s q u i t e p r o n e t o b e d i t z y .
Y o u r T e x t M e s s a g e : " Y o u c a n ' t a l w a y s g e t w h a t y o u w a n t , b u t i f y o u t r y , s o m e t i m e s - - y o u g e t w h a t y o u n e e d . "
P r e s i d e n t i a l A p p r o v a l R a t i n g 5 ± D r i n k S i z e
Y o u r R e a l O p i n i o n : I g u e s s w e a r e l u c k i e r t h a n w e d e s e r v e . 4 8 O u n c e s
A v i a n s M a m m a l s
g o o s e c o w c h i c k e n
c h i c k e n h o r s e
d u c k s h e e p D r o p d o w n C o n t r o l
p i g e o n h o g
s p a r r r o w g o a t T o d a y ' s S p e c i a l s W h a t ' s F o r L u n c h ?
m a g p i e r a b b i t b a k e d f i s h - a n d - b e e r
r o b i n m o o s e D r i n k M e n u >
d o v e m o u s e B a k e d f i s h w i t h o n i o n s
B e e f b r i s k e t w i t h g a r l i c
S c r o l l b o x C o n t r o l S c r o l l e x t C o n t r o l S a u t e e d p e a s a n d c a r r o t s
G r e e n b e a n s
F r u i t s a l a d c k
M u t t o n c h o p s
C a p t u r e D i a l o g T o F i l e
D O N E A L T + z = = p l a i n t e x t
A L T + S H I F T + z = = h t m l

In this screenshot, the user has highlighted the 'Drink Menu' item of the main menu and has pressed the 'Enter' key which opens the sub-menu. The user may now select an item from the sub-menu by pressing the 'Enter' or 'Spacebar' keys, or may return to the parent menu, or may move on to another control without making a selection.

Either way, the sub-menu control returns to its 'invisible' state, and the input focus shifts to another control.

Note also that sub-menus may be configured as standalone 'context menus'.

Please refer to our 'FileMangler' file management utility for a complex Menuwin implementation.

N c D i a l o g - C a p t u r e D i a l o g w i t h C o n t r o l s
W r i t e a m e s s a g e : M u l t i - L i n e T e x t B o x ( a l l p r i n t i n g c h a r s ) B i l l b o a r d C o n t r o l ( r e a d o n l y )
" Y o u c a n ' t a l w a y s g e t w h a t I l s a , I ' m n o g o o d a t b e i n g n o b l e , b u t T h e r e o n c e w a s a m a n f r o m P o u g h k e e p s i e
i t d o e s n ' t t a k e m u c h t o s e e t h a t t h e W h o o f t e n g o t r a t h e r t i p s y .
[ ] G r e e n M e s s a g e s p r o b l e m s o f t h r e e l i t t l e p e o p l e d o n ' t H e w a s r o u n d l y a s h a m e d ;
[ ] M a g e n t a M e s s a g e s a m o u n t t o a h i l l o f b e a n s i n t h i s c r a z y T w a s h i s w i f e t h a t h e b l a m e d ,
[ ] Y e l l o w M e s s a g e s w o r l d . S o m e d a y y o u ' l l u n d e r s t a n d t h a t . F o r s h e w a s q u i t e p r o n e t o b e d i t z y .
Y o u r T e x t M e s s a g e : " Y o u c a n ' t a l w a y s g e t w h a t y o u w a n t , b u t i f y o u t r y , s o m e t i m e s - - y o u g e t w h a t y o u n e e d . "
P r e s i d e n t i a l A p p r o v a l R a t i n g 5 ± D r i n k S i z e
Y o u r R e a l O p i n i o n : I g u e s s w e a r e l u c k i e r t h a n w e d e s e r v e . 4 8 O u n c e s
A v i a n s M a m m a l s
g o o s e c o w c h i c k e n
c h i c k e n h o r s e
d u c k s h e e p D r o p d o w n C o n t r o l
p i g e o n h o g
s p a r r r o w g o a t T o d a y ' s S p e c i a l s W h a t ' s F o r L u n c h ?
m a g p i e r a b b i t b a k e d f i s h - a n d - b e e r
r o b i n m o o s e D r i n k M e n u >
d o v e m o u s e B a k e d f i s h w i t h o n i o n s B e e r
B e e f b r i s k e t w i t h g a r l i c W i n e
S c r o l l b o x C o n t r o l S c r o l l e x t C o n t r o l S a u t e e d p e a s a n d c a r r o t s T e a
G r e e n b e a n s C o f f e e
F r u i t s a l a d
M u t t o n c h o p s
C a p t u r e D i a l o g T o F i l e
D O N E A L T + z = = p l a i n t e x t
A L T + S H I F T + z = = h t m l

In this screenshot, the user has selected items from the Menuwin controls, the Menuwin controls have returned to their inactive states, and the input focus has moved on to the 'Done' pushbutton, which completes the full tour of our user-interface control objects.

Of course, this is just a quick overview of the NcDialog API, but we hope that it presents a clear picture of the possibilities.

The working code for this dialog is located in NcDialog API source code: Dialog2 Test #7.


Console-based applications are incredibly powerful AND very simple to implement; however, they are often far too complex for novice users to navigate successfully. The NcDialog API brings your world-changing application within reach of GNU/Linux newbies and will still manage to impress even the most hardened of console warriors.

 Tame the Command-line Beast !! 

N c D i a l o g - C a p t u r e D i a l o g w i t h C o n t r o l s
W r i t e a m e s s a g e : M u l t i - L i n e T e x t B o x ( a l l p r i n t i n g c h a r s ) B i l l b o a r d C o n t r o l ( r e a d o n l y )
" Y o u c a n ' t a l w a y s g e t w h a t I l s a , I ' m n o g o o d a t b e i n g n o b l e , b u t T h e r e o n c e w a s a m a n f r o m P o u g h k e e p s i e
i t d o e s n ' t t a k e m u c h t o s e e t h a t t h e W h o o f t e n g o t r a t h e r t i p s y .
[ ] G r e e n M e s s a g e s p r o b l e m s o f t h r e e l i t t l e p e o p l e d o n ' t H e w a s r o u n d l y a s h a m e d ;
[ ] M a g e n t a M e s s a g e s a m o u n t t o a h i l l o f b e a n s i n t h i s c r a z y T w a s h i s w i f e t h a t h e b l a m e d ,
[ ] Y e l l o w M e s s a g e s w o r l d . S o m e d a y y o u ' l l u n d e r s t a n d t h a t . F o r s h e w a s q u i t e p r o n e t o b e d i t z y .
Y o u r T e x t M e s s a g e : " Y o u c a n ' t a l w a y s g e t w h a t y o u w a n t , b u t i f y o u t r y , s o m e t i m e s - - y o u g e t w h a t y o u n e e d . "
P r e s i d e n t i a l A p p r o v a l R a t i n g 5 ± D r i n k S i z e
Y o u r R e a l O p i n i o n : I g u e s s w e a r e l u c k i e r t h a n w e d e s e r v e . 4 8 O u n c e s
A v i a n s M a m m a l s
g o o s e c o w c h i c k e n
c h i c k e n h o r s e
d u c k s h e e p D r o p d o w n C o n t r o l
p i g e o n h o g
s p a r r r o w g o a t T o d a y ' s S p e c i a l s W h a t ' s F o r L u n c h ?
m a g p i e r a b b i t M e n u w i n C o n t r o l b a k e d f i s h - a n d - c o f f e e
r o b i n m o o s e
d o v e m o u s e F l y i n g C r i t t e r s : R o b i n s s i n g
S c r o l l b o x C o n t r o l S c r o l l e x t C o n t r o l W a l k i n g C r i t t e r s : M o o s e b e l l o w
Z o o C r i t t e r s : C h i c k e n s c l u c k
C a p t u r e D i a l o g T o F i l e
D O N E A L T + z = = p l a i n t e x t
A L T + S H I F T + z = = h t m l


The final screenshot is of a similar dialog window which displays the NcDialog API's basic set of defined color attributes. Additional color combinations and attribute modifiers are available in the API itself. See the NcDialog API documentation for details.

The 'Done' Pushbutton is the only control in this dialog, and thus has the input focus.
N c D i a l o g - C a p t u r e S i m p l e D i a l o g
P L A I N B O L D U N D E R L I N E R E V E R S E B l d + R e v B l d + U n d r R e v + U n d r B l d + R e v + U n d r
b w T e x t b w B T e x t b w U T e x t b w R T e x t b w G T e x t b w X T e x t b w Y T e x t b w Z T e x t
r e T e x t r e B T e x t r e U T e x t r e R T e x t r e G T e x t r e X T e x t r e Y T e x t r e Z T e x t
g r T e x t g r B T e x t g r U T e x t g r R T e x t g r G T e x t g r X T e x t g r Y T e x t g r Z T e x t
b r T e x t b r B T e x t b r U T e x t b r R T e x t b r G T e x t b r X T e x t b r Y T e x t b r Z T e x t
b l T e x t b l B T e x t b l U T e x t b l R T e x t b l G T e x t b l X T e x t b l Y T e x t b l Z T e x t
m a T e x t m a B T e x t m a U T e x t m a R T e x t m a G T e x t m a X T e x t m a Y T e x t m a Z T e x t
c y T e x t c y B T e x t c y U T e x t c y R T e x t c y G T e x t c y X T e x t c y Y T e x t c y Z T e x t
g y T e x t g y B T e x t g y U T e x t g y R T e x t g y G T e x t g y X T e x t g y Y T e x t g y Z T e x t
b b k T e x t b b k B T e x t b b k U T e x t b b k R T e x t b b k G T e x t b b k X T e x t b b k Y T e x t b b k Z T e x t
b r e T e x t b r e B T e x t b r e U T e x t b r e R T e x t b r e G T e x t b r e X T e x t b r e Y T e x t b r e Z T e x t
b g r T e x t b g r B T e x t b g r U T e x t b g r R T e x t b g r G T e x t b g r X T e x t b g r Y T e x t b g r Z T e x t
b b r T e x t b b r B T e x t b b r U T e x t b b r R T e x t b b r G T e x t b b r X T e x t b b r Y T e x t b b r Z T e x t
b b l T e x t b b l B T e x t b b l U T e x t b b l R T e x t b b l G T e x t b b l X T e x t b b l Y T e x t b b l Z T e x t
b m a T e x t b m a B T e x t b m a U T e x t b m a R T e x t b m a G T e x t b m a X T e x t b m a Y T e x t b m a Z T e x t
b c y T e x t b c y B T e x t b c y U T e x t b c y R T e x t b c y G T e x t b c y X T e x t b c y Y T e x t b c y Z T e x t
b g y T e x t b g y B T e x t b g y U T e x t b g y R T e x t b g y G T e x t b g y X T e x t b g y Y T e x t b g y Z T e x t
- - - b k r e T e x t b k g r T e x t b k b r T e x t b k b l T e x t b k m a T e x t b k c y T e x t b k g y T e x t
r e b k T e x t - - - r e g r T e x t r e b r T e x t r e b l T e x t r e m a T e x t r e c y T e x t r e g y T e x t
g r b k T e x t g r r e T e x t - - - g r b r T e x t g r b l T e x t g r m a T e x t g r c y T e x t g r g y T e x t
b r b k T e x t b r r e T e x t b r g r T e x t - - - b r b l T e x t b r m a T e x t b r c y T e x t b r g y T e x t
b l b k T e x t b l r e T e x t b l g r T e x t b l b r T e x t - - - b l m a T e x t b l c y T e x t b l g y T e x t
m a b k T e x t m a r e T e x t m a g r T e x t m a b r T e x t m a b l T e x t - - - m a c y T e x t m a g y T e x t
c y b k T e x t c y r e T e x t c y g r T e x t c y b r T e x t c y b l T e x t c y m a T e x t - - - c y g y T e x t
g y b k T e x t g y r e T e x t g y g r T e x t g y b r T e x t g y b l T e x t g y m a T e x t g y c y T e x t - - -
C a p t u r e D i a l o g T o F i l e
T h i s c o l o r a r r a y v a l i d a t e s t h e C S S d e f i n i t i o n s i n D O N E A L T + z = = p l a i n t e x t
' s c r e e n s h o t - s t y l e s . c s s ' A L T + S H I F T + z = = h t m l