GridSizer Project

From Audacity Wiki
Jump to: navigation, search
Summer of Code 2008 logo The GridSizer project created two new GUI classes which were tested in a demo application. The new classes will be a significant step towards a much cleaner design for track display. As part of the project, an evaluation was made of the benefits of transitioning to the wxAUI toolbar and window docking library.

This page reviews and discusses progress of the GridSizer project during GSoC 2008. Further discussion can also be found in the audacity-devel mailing list.


Contents

Abstract

Progress

Drag and Drop is done with the Drag'n'Drop framework of wxWidgets. This has the benfit of dragging TableCtrl cells between different TableCtrls and even different Applications.

So far events are generated on enter, leave, drag-over and dropping data on a cell with the coords of the cell and sometimes the mouse position. That's sent to the application. There will be some standard behaviors one can choose from.


The code is in the Audacity-Extra sourceforge project, which you can access via CVS. The documentation is online, too.


WxTableCtrl-puzzle.png

A simple fifteen puzzle is on the first page of the test application. You can Drag'n'Drop the buttons to unjumble them. This shows Drag'n'Drop behavior, swapping and vetoing.


WxTableCtrl-klotski.png

On the second page there is a klotski game. Shows span of cells.


WxTableCtrl-wavetrack.png

On the last page there is a trackpanel similar to the audacity trackpanel, but with bitmaps instead of real wave-forms. Shows more complex panels in a TableCtrl and a TableCtrl in a ScrolledWindow.

To Dos

  • Toolbar with draggable buttons in test app. Confirm that mouse-overs still work and that button clicks still can be acted on.
  • Discuss and refine hooks for wxTableCtrl behaviour.
  • Discuss and refine mouse-over behaviours to show that dragging is possible.
  • Discuss similarities/differences between wxTableCtrl and existing wxListCtrl in report mode and wxDataViewCtrl.
  • Discuss relation to wxAUI and to wxRL. After the mid-term a decision will be needed on whether to try to work closely with wxRL, wxWidgets, neither or both during GSoC.
  • Make test app more polished - this is mainly about making nicer bitmaps for the cell contents, adding more buttons to switch and select modes of operation.
  • Proportional/neighbour resizing
  • Ensure we support both 'wxDragGridSizer' (rows all expand together) and 'wxFlexGridSizer' (only current row expands) modes. Ensure we can separately enable/disable swapping and sizing behaviour.
  • Full wxWidgets grade documentation on wxTableCtrl and the testapp. This work may benefit from a prior investigation of what tools wxWidgets use in producing their documentation.


9th June 2008

Issues currently under discussion:

  • It's probably going to be called TableCtrl, since it has qualities of both a sizer and a Window.
  • Use of a global object (or static) for passing start of drag. Is this likely to cause a problem? Needs some investigation.
  • Repaint not taking place when expected.
  • Provision of standard methods such as swapping two items, so that the user of TableCtrl doesn't need to write them himself.
  • Currently using drag-and-drop. Will we be able to get existing Audacity behaviour of swapping tracks without releasing the mouse button?
  • Whether windows within windows within TableCtrl need to have the drag behavior, or just the first level?
  • Behaviour of dragging when within a wxScrolledWindow.

14th June 2008

Latest source now addresses these issues:

  • wx2.9 macro use made conditional so that can be built with wx2.8.7
  • Some stub functions now return values, to compile under MSVC (only warnings under gcc).
  • Copy constructors added to work around DECLARE_NO_COPY_CLASS().
  • WXDLLEXPORT added so that library can be compiled as an intermediate between wx and application, rather than being built into wx (needed for early Audacity deployment).
  • Style of function calls changed to match updated CodingStandards
  • Now as a tar.zip for easier download.

18th June 2008

Latest source now addresses these issues:

  • wxTableCtrl in a ScrolledWindow. The WaveTrack page shows this
  • Swapping without mouse-release works on wxButtons, there are some problems with more complex wxWindows (like at the trackpanel).
  • You can enable dragging for children


21th June 2008

Latest source now addresses these issues:

  • Swapping is much more robust and works even on more complex wxWindows
  • wxTableCtrl in a wxTableCtrl works (Had to veto all D'n'D actions between different TableCtrls).

24th June 2008

Latest source now addresses these issues:

  • some wxAUI code included (toolbar in the wave track page)
  • fixes a bug which causes strange swapping behavior
  • fixes a bug which causes crashes on swapping (self-deleting cells)

Issues currently under discussion:

  • Accessibility features and wxAUI? Seems to be no problem

First paragraphs of the wxAUI report are written.

  • James: One option is to post a draft of it on wiki Transitioning To wxAUI. We can add comments and questions on the talk page.
  • Hildensia: I'll do that, when it's a little bit more structured and rich in content.


26th July 2008

Latest source now addresses these issues:

  • Klotski page works (dragging of spanned cells)
  • a wxTableCtrl toolbar on the wave-page
  • you can switch at runtime between a clickable and a dragable mode (SetClickable(bool))
  • shows resize-arrows on the cell edges
  • fixes some misbehavior caused by nested wxAUI toolbars
  • doesn't flicker under Mac OS X
  • fixes a bug which causes the wave tracks to get out-of-order

3rd August 2008

Latest source now addresses these issues:

  • shows resize-arrows between cells
  • you can specify where you want to have resize-arrows via style-flags
  • send resize events on the edges
  • send resize events between cells
  • resize events hold the following information:
    • cell row/col
    • new size of the cell (if it should be simply resized)
    • position (top, bottom, right, left, between and combinations of these) of the resize event
    • difference (delta) between old and new height/width
  • resizing of wave tracks shows a very simple resize algorithm

6th August 2008

Latest source now addresses these issues:

  • the wave page shows the three standard-resizing algorithms:
    • static resizing. This is the resize-behavior of the whole trackpanel. So all tracks under the resizied track are moved up/down.
    • neighbour resizing. This is what happens when you resize a stereo track between left and right channel. So the neighbour cell downsizes/increases accordingly
    • proportional resizing. This is what happens to a stereo track if you resize it as a whole. So the ratio of the sizes is kept.
  • fixes a bug, which causes assertions when releasing the left mouse button
  • fixes a bug, which prevents the app from switching to the normal mouse cursor on windows
  • more resizing 'styles' (You can now choose that a table-control only can be resized between the cells)

Bug:

  • crashes when you swap the channels of a stereo track and resize this track afterwards

7th August 2008

Bugfixes:

  • Crashes when resizing at the edge of gap between two cells. Fixed.
  • Crashes when resizing and then moving the mouse only over non-resizable cells and dragging that cell. Fixed.

Personal tools