GUI menu
Status: Alpha
Brought to you by:
shaiay
Attached is a patch with a skeleton menu for octplot
0.3.9. So far it has two functionalities: save figure and
close window. (There also are Insert->Title, X-label,
Y-label, but I'm not familiar enough with octplot
internals to implement them).
This is perhaps intended more as a discussion opener
than an actual addition to octplot :)
patch file
Logged In: YES
user_id=136223
Thanks for this patch.
I think it is a good thing to have a menu, and perhaps also
a toolbar. After reading this patch, I'm not sure if it will
work with multiple figures. Will it?
This is important because I have observed that poeple tend
to work with multiple figures, and I think octplot is now at
a stage where most of the multiple figure stuff works. I
would hate to introduce a patch that breaks this.
Shai
Logged In: YES
user_id=814068
Hello Shai,
You are correct, it doesn't work for several figures; sorry
for not stating it more clearly. (This is due to this patch
being the first FLTK coding I've done: I need to figure out
how to get the handle for the FigureWindow from the
what_widget_is_this parameter to save_dialog function :) ).
Besides fixing that issue, what kind of GUI shortcuts should
there be?
Adding/changing of labels / titles / legends / linewidths ...?
Also, there are a few questions I haven't found an answer
to, could you help?
The File->Close is callbacked to
FigureWindow::StaticFigureClose, which closes all
FigureWindows in current octplotapp. By pressing ESC-button,
only the current is closed. But I cannot find how ESC is
handled?
How are the different graphics objects saved in octplotapp?
E.g., how do I get the number of subplots in a FigureWindow
(btw, are they separate Figure s or do they share one?). And
how do I get e.g. the Title of a specific subplot?
kalle
Logged In: YES
user_id=136223
Kalle,
1) this closing of windows and handling of such events is
something of a black art in fltk. It took me some time to
doit right, and frankly I don't exactly remember how I did
it, but try looking at:
http://www.fltk.org/articles.php?L378+I0+TFAQ+P1+Q
http://www.fltk.org/articles.php?L379+I10+TFAQ+P1+Q
2) figurewindow & figure are the only FLTK objects in
octplot. All other objects do not inherit from FLTK objects
and use the handle graphics methods to store properties and
access them. So, to get at subplots, you would have to look
in the "children" property of the figure, which lists all
the axes of this figure. Each axes is a subplot. have a look
at the prop-*.{cpp,h} files for theses objects. I have
helper functions to access them, defined in globals.h &
util.cpp, so to get the number of subplots for the current
figure:
(::Get<HandleVect>(this,"children")).Size()
To change the title of the current axes (subplot) :
::Set(::Get<HandleVect>((::Get<HandleVect>(this,"currentaxes"))(),"title")(),"text","This
is the new title");
The property names and values are documented in *_props.m,
so to see a figures property, you should, from within octave:
help figure_props
Shai
p.s. For a great FLTK cheat page:
http://seriss.com/people/erco/fltk/