show_special()

Purpose

Provides for various special effects that can be used to change the appearance of controls in a map

Syntax

void pascal show_special(int mapnr, int fieldnr, int object, int flags)

Parameters

int mapnr

Number of map

 

int fieldnr

Number of field

 

int object

Identifies the object to be displayed:

  • SHOW_BLANK causes the text of the control to be removed - calling show_special() like this is equivalent to using field_blank()
  • SHOW_TICK shows a tick against a menu item without changing the text displayed in the control.
  • SHOW_STAR causes the text of a control (usually an edit control) to be prefixed with an asterisk. Several DP4 utilities use this functionality to allow multiple selections from a window of records.
  • SHOW_NA specifies that the control is disabled (from 4.603). It also causes the text of edit controls to be replaced with a dash.
  • SHOW_MORE is used to show a scrollbar in pick_record() and similar functions. The flags value specifies the state of the scrollbar.
  • SHOW_POPUP is used to show a secondary pulldown indicator (a triangle) after the text of the control.
  • SHOW_HIDE is used to completely hide a control in a map. DP4 does not unhide the control automatically even if it is used as an input field. This setting was introduced in release 4.623
  • SHOW_REVEAL is used to redisplay a control that has been hidden with the SHOW_HIDE option of show_special(). This setting is introduced in release 4.623

 

int flags

Apart from the SHOW_MORE case flags are used as for the regular show() function. The only option that is likely to be useful is SKIP_MISSING_FIELD<./P>

 

The parameter flags may take any combination of the same values as listed for the show() function

Description

Most of the time you will not call this function directly. It is used internally in the implementation of functions such as pick_record() and map_bar_choose(). However the SHOW_HIDE and SHOW_REVEAL functions may be generally useful, and some of the other options may be useful if you are implementing your own high level functions for menus or record selection from a list of choices.

See also

map_bar_choose(), pick_record()

Example

/*
C Functions Reference Manual
----------------------------
Filename: SHOW_SPE.C
Example: show_special
Purpose: Insert tick before active items in a
pull-down menu
*/

/*
#c
#db wintext
#mapname test1
#end
*/

#include "dp4.h"
#include "winmenu.h"

#define ACTIONBAR 2
#define FILE_PULLDOWN 3

void process(NOPARAS);
void draw_extra(int mapnr);

void process()
{
int option_nr = 0x11;
short banned_list[8];

map(2, MENUMAP);
banned_list[0] = 0;
map_bar_choose(ACTIONBAR, &option_nr,
0, draw_extra, banned_list);
}

void draw_extra(mapnr)
{
/* Place a tick against first item of first
pull-down */
if (mapnr == FILE_PULLDOWN)
show_special(mapnr, 1, SHOW_TICK, DEFAULT);
}