Re: System.mode as display item

From: Joost Bataille <ja_at_nee.be>
Date: Mon, 16 Dec 2002 13:29:17 +0100
Message-ID: <atkgus$14qdb8$1_at_ID-171327.news.dfncis.de>


"Ben" wrote:
>I would like to display the current mode in a display item so users can see
whether they are currently in query mode etc.

If you build an application with Headstart this is done automatically for you: when in enter-query mode the background color off all queryable items changes to yellow.

I've written some code that more or less does the same (has not been tested extensively..)
It requires a visual attribute 'VA_QUERYABLE'

PROCEDURE set_va_queryable ( p_modus in varchar2) IS

l_current_item                varchar2(30);
l_trigger_block               varchar2(30);
l_last_item                   varchar2(30);

begin

l_current_item := name_in('system.trigger_item');
l_trigger_block := name_in('system.trigger_block');
l_last_item := l_trigger_block||'.'||get_block_property(l_trigger_block,
last_item);

go_item(get_block_property( l_trigger_block, first_item));

while not name_in('system.cursor_item') = l_last_item loop
  if p_modus = 'enter' then
   if get_item_property(name_in('system.cursor_item'), item_type) in ('TEXT ITEM', 'LIST') then

     if get_item_property(name_in('system.cursor_item'), queryable) = 'TRUE' then

      set_item_property(name_in('system.cursor_item'), visual_attribute, 'VA_QUERYABLE');
     end if;
   end if;

 elsif p_modus = 'exec' or p_modus = 'cancel' then    if get_item_property(name_in('system.cursor_item'), item_type) in ('TEXT ITEM', 'LIST') then

     if get_item_property(name_in('system.cursor_item'), queryable) = 'TRUE' then

        set_item_property(name_in('system.cursor_item'), visual_attribute, 'DEFAULT');
     end if;
   end if;
 end if;

 next_item;

end loop;

go_item(l_current_item);

end;

Joost Bataille
University of Amsterdam ICT centre Received on Mon Dec 16 2002 - 13:29:17 CET

Original text of this message