On Sat, 12 Jul 2008, Carl Zmola wrote:

> I am finally getting around to implementing a feature I have wanted for
> a while.
>
> This message has two parts.
>
> 1) is the question, how do I go about getting SVN write access, and what
> is the development process.

When you have a working patch, post it here so we can look at it and 
apply it.

> 2) Here is what I am trying to do, and my approach for review
>
> Feature:
> When you double click on an item (task) in the treeview, I would like
> the viewer to automatically open to the field that you clicked on.
> For instance,  If I click on the categories column, I want the viewer to
> open to the category tab.  If I click on the "Start Date" column, I
> would like the "Dates" tab to show and the "Start Date" column to have
> focus.

Indeed, it would be nice.

> Approach:
> It is not hard to get the column that is clicked on from a treectrl,
> the column number can be transfered to a "field" that the viewer will
> know about. (I have not figured out the mapping, but I suggest it be
> stored in the treectrl somehow)

Mmmh, after a quick look, it seems that it's not that simple to know 
in which column the user has double-clicked. With the TreeCtrl, one 
may probably use the Point attribute of the wxTreeEvent, but it seems 
that for a list control, it's always (0, 0) (it's only used in 
drag&drop).

> I specifically want to add a kwarg to that viewers should process called
> "openOnField".  If the viewer doesn't process it, there is no harm.
> Then the task viewer can use "openOnField" to set the correct tab and
> set focus to the correct field.  I can add support for other viewers if
> there is a desire.

It would be nice to have it for both the task list and the task tree.

> To do this, I need to be able to pass all this information through the
> command notification process.
> Step one is to process the kwargs at the taskviewer
> Step two is to allow kwargs to pass into the  TaskViewer.editItemDialog
> method. Below is the current editItemDialog function
>
>    def editItemDialog(self, *args, **kwargs):
>        return dialog.editor.TaskEditor(wx.GetTopLevelParent(self),
>            command.EditTaskCommand(self.list, self.curselection()),
>            self.list, self.uiCommands, self.settings, self.categories,
>            bitmap=kwargs['bitmap'])
>
> I was just wondering if there is a reason that kwargs other than
> 'bitmap'  are not being passed through, and if specific kwargs should be
> filtered.  I don't believe it matters.  I was thinking about just
> passing through all kwargs.

Don't know.

> TaskEdit (uicommand.py) will also need to be modified to pass the field
> through.
>
> If someone can help me figure out a generic way to turn a column in the
> task tree view into a "field" string that the task editor dialog can
>
> Is there already a concept of "field" from the XML that can be used by
> the viewer to set the active tab&control?
>
> When I last looked (last January) I could not figure out a clean way to
> get all this information.  If I recall, the column names in the task
> tree view were not derived from the same data that showed the labels on
> the TaskEditor dialog.

The way I would do it (not necessarily the better):

  * Change ListCtrl and TreeCtrl so that they can figure out which 
column the user has double-clicked (say, a 
GetClickedColumn(self, event) method)

  * Then, the ViewerWithColumns may use this to determine the actual 
Column object from the event object.

  * And the TaskEdit UI command uses the viewer (which it knows about 
since it's a ViewerCommand) to get the column and pass it to the 
TaskEditor constructor.

  * Finally, the task editor does its job of selecting the right tab 
base on the column's name().

Cheers
Jérôme

Reply via email to