Selecting a toolbar in taskwindow
Posted: 27 Feb 2006 11:26
If you have several toolbar designs and you want to display a particular one at runtime, here is the method (the code is placed in taskwindow.pro)
This example shows switching between two toolbars - a "full" and a "partial", depending if the user has entered all the required data.
Code: Select all
domains
tb_design=full;partial.
facts
xtoolbar_showing:tb_design:=partial.
predicates
set_correct_toolbar:() procedure ().
set_correct_toolbar:(tb_design) procedure (i).
clauses
set_correct_toolbar():-
input_data_complete,!,
set_correct_toolbar(full).
set_correct_toolbar():-
set_correct_toolbar(partial).
set_correct_toolbar(TB_TYPE):-%no need to change
xtoolbar_showing=TB_TYPE,!.
set_correct_toolbar(full):-
vpiToolbar::remove(getVPIWindow()),
projectToolbar::create(getVPIWindow()).
set_correct_toolbar(partial):-
vpiToolbar::remove(getVPIWindow()),
toolbar_partial::create(getVPIWindow()).