sm_finquire(int field_number, int which_property)
sm_e_finquire(string field_name, int element, int which_property)
sm_i_finquire(string field_name, int occurrence, int
which_property)
sm_n_finquire(string field_name, int which_property)
sm_o_finquire(int field_number, int occurrence, int which_property)
Now, in Jam7, all of this information is available as properties of the field. It is possible to both query and directly set these properties. The table below, lists the Jam5 which_property mnemonics, their numerical values, their corresponding Jam7 property and the meaning of the property. All references to this function can be changed to querying the property directly as in the examples.
Jam5 finquire mnemonic |
Hex Value |
Jam7 Property |
Description |
FD_LINE |
0x4000 |
start_row *2 |
Line of Top Corner of field. |
FD_COLM |
0x4001 |
start_column *2 |
Column of Top Corner of field. |
FD_ATTR |
0x4002 |
*1 |
Text Color & Property Attributes. |
FD_LENG |
0x4003 |
length |
On-screen field length. |
FD_ASIZE |
0x4004 |
array_size |
Number of visible onscreen elements in array. |
FD_ELT |
0x4005 |
*3 |
Onscreen element #. |
FD_SHLENG |
0x4006 |
max_data_length |
Maximum data length — including what portion could be shifted into view. |
FD_SHINCR |
0x4007 |
shift_increment |
Number of characters to increment when shifting data within field left or right. |
FD_SHOFS |
0x4008 |
current_offset |
Current Shift Offset (number of positions field has been shifted; 0 if at the left edge). |
FD_SCINR |
0x4009 |
scroll_increment |
Scrolling increment for scrolling array (for Next/Prev page keys). |
FD_SCFLAG |
0x400A |
circular |
Is scrolling array circular. (PV_YES/PV_NO) |
FD_SCATTR |
0x400B |
*1 |
Text Color & Property attributes of specified occurrence. Only was used with sm_i_finquire and sm_o_finquire variants. |
FD_FELT |
0x400C |
first_occurrence |
First visible occurrence of scrolling array. |
Notes on Jam5 finquire mnemonic to Jam7 Property Conversion Table
proc get_cur_elem() { /* Function does not check widget type. This func can only be called */ /* on widgets that can have arrays -- text widgets, radio buttons, check boxes, */ /* pushbuttons, and some Windows specific widgets. */ vars elem, cur_fld = @screen("@current")->fldnum vars num_occ = @field_num(cur_fld)->array_size if (num_occ = 1) return 1 for elem = 1 while (@field_num(cur_fld)[[elem]]->fldnum != cur_fld && elem <= num_occ) {} /* Just in case it didn't find field before ending loop, return 0 */ if (@field_num(cur_fld)[[elem]]->fldnum != cur_fld) return 0 return (elem) }
top_row = sm_finquire(:cur_fld, FD_FELT)
top_row = @field_num(cur_fld)->first_occurrence
num_elems = sm_n_finquire("status_A", FD_ASIZE)
num_elems = @widget("status_A")->array_size
is_text_red = (sm_n_finquire("cur_status", FS_SCATTR) & 4)
is_text_red = (@widget("cur_status")->fg_color_num & RED)