If you have created and attached a status bar as described above you should remove it again.
A standard GUI project comes with a status bar:
Code: Select all
implement projectToolbar
open vpiDomains, vpiToolbar, resourceIdentifiers
class facts
statusCell : statusBarCell := erroneous.
clauses
create(Parent) :-
StatusBar = statusBar::newApplicationWindow(),
statusCell := statusBarCell::new(StatusBar, 0),
StatusBar:cells := [statusCell],
Toolbar = vpiToolbar::create(style, Parent, controlList),
setStatusHandler(Toolbar, displayStatus).
clauses
displayStatus(Text) :-
statusCell:text := Text.
You can add more
statusBarCells if you like, see for example in the
sciLexerStatusBar
Code: Select all
implement sciLexerStatusBar inherits statusBarControl
clauses
new(Parent) :-
statusBarControl::new(Parent),
Cell_0 = statusBarCell::new(This, statusBarCellWidth),
cell_position := statusBarCell::new(This, statusBarCellWidth),
cell_modified := statusBarCell::new(This, statusBarCellWidth),
cell_insert := statusBarCell::new(This, statusBarCellWidth),
cells := [Cell_0, cell_position, cell_modified, cell_insert].
This code is "inside" a dedicated statusBarControl class, in the project case it would look like this:
Code: Select all
implement projectToolbar
open vpiDomains, vpiToolbar, resourceIdentifiers
class facts
cell_position : statusBarCell := erroneous.
cell_modified : statusBarCell := erroneous.
cell_insert : statusBarCell := erroneous.
clauses
create(Parent) :-
StatusBar = statusBar::newApplicationWindow(),
Cell_0 = statusBarCell::new(StatusBar, statusBarCellWidth),
cell_position := statusBarCell::new(StatusBar, statusBarCellWidth),
cell_modified := statusBarCell::new(StatusBar, statusBarCellWidth),
cell_insert := statusBarCell::new(StatusBar, statusBarCellWidth),
StatusBar:cells := [Cell_0, cell_position, cell_modified, cell_insert],
Toolbar = vpiToolbar::create(style, Parent, controlList),
setStatusHandler(Toolbar, displayStatus).
To set the texts you will need to export predicates or (perhaps better) properties.
Code: Select all
class projectToolbar
...
properties
position : string.
...
end class projectToolbar
with a suitable implementation:
Code: Select all
clauses
position(T) :-
cell_position:text := T.
clauses
position() = cell_position:text.
I think we will change the default project structure for this, because it is somewhat strange that the status bar is part of the
projectToolbar class.