octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #53046] Variable Editor: feature request to ma


From: Dan Sebald
Subject: [Octave-bug-tracker] [bug #53046] Variable Editor: feature request to make multiple tables visible at once.
Date: Fri, 16 Feb 2018 05:12:11 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0

Follow-up Comment #21, bug #53046 (project octave):

OK, this changeset should be in good shape.  Here's a short summary of changes
from the previous candidate:

1) I incorporated the recent addition of scrollbar behavior
(var_editor_tab::handle_horizontal_scroll_action,
var_editor_tab::handle_vertical_scroll_action):

http://hg.savannah.gnu.org/hgweb/octave/rev/ed2d9ef336a7

There's a bug in the behavior of the column/row sizes (may have been there
prior), but can address that later.

2) I moved some of the member functions I first moved to variable_editor_model
back to variable_dock_widget.  They just didn't seem to belong there. 
Specifically, the range_selected() function isn't really a model type of
thing.  This actually gets rid of some pointer indirection.  It might be a
worthwhile step to create a new class derived from QTableView and put some of
the functions in there--since it has access of the model via "setModel()",
might as well put a few routines, signals and slots with the QTableView.

3) There was a lot of repetition in the code, so I tried to improve code-reuse
with routines like:


QSignalMapper *
make_plot_mapper (QMenu *menu)
{
  QList<QString> list;
  list << "plot" << "bar" << "stem" << "stairs" << "area" << "pie" << "hist";

  QSignalMapper *plot_mapper = new QSignalMapper (menu);

  for (int i = 0; i < list.size(); ++i)
    {
      plot_mapper->setMapping
        (menu->addAction (list.at (i), plot_mapper, SLOT (map ())),
         "figure (); " + list.at (i) + " (%1); title (\"%2\");");
    }

  return plot_mapper;
}


that can be used for the three different context menus and the plot button in
the tool-bar.  variable_dock_widget::add_edit_actions() is another new one. 
It handles all the edit actions in context menus...and it shares a lot of
similarities with the tool-bar buttons, but I couldn't figure out a good way
of reusing the code there.

4) Notice in the above code I added a second format string for a second
argument (same as the first argument) which will put the title of the data
plotted on the plot.  If it isn't to your liking, make adjustments with future
changesets.  In that regard, as with the previous versions of the changeset,
there is now more useful selection capability.  One can select a column of
data and plot just that column rather than the whole matrix.

5) The main issue I had to fix was that focus of the container class
variable_dock_widget, in particular make sure that the blue highlighted widget
title makes sense.  This actually wasn't too bad, and I spent more time just
thinking about it rather than coding away.  The Qt documentation states that 


focus : const bool

This property holds whether this widget (or its focus proxy) has the keyboard
input focus


The "or its focus proxy" is the important part.  I reversed the proxy: rather
than making variable_dock_widget a proxy for QTableView, I made QTableView the
proxy for variable_dock_widget and then attached the application's
focusChanged() signal to a new variable_dock_widget slot:


  connect (QApplication::instance(), SIGNAL (focusChanged (QWidget *, QWidget
*)),
           page, SLOT (handle_focus_change (QWidget *, QWidget *)));


and that handle_focus_change() sets the label color appropriately.  And in
set_editable() I set the proper proxy (and focus/no-focus) based upon whether
it is the QTableView or QTextEdit that is the valid representation.

(file #43332)
    _______________________________________________________

Additional Item Attachment:

File name: octave-multipanel_variable_editor-djs2018feb16.patch Size:96 KB


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?53046>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]