Automatic tree item expansion

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Automatic tree item expansion

Michael Hieke-2
Hi all,

how do you feel about automatic expanding tree items?  I must say I
don't like several aspects of current behaviour under MSW:

- Connecting to a database with pressing [Enter] expands and collapses
the tree item.  That causes flicker, and looks downright ugly when
animation effects are enabled.

- Connecting to a database with double click expands, collapses and
expands the tree item.  See above.  Freezing and thawing the tree
control would disable the animation, so that's more of a hack as well.

- When I connect with two databases I have to make sure that I first do
that with the one that is below the other - otherwise I have to hunt for
the other database node, because it got scrolled out of view :-(  For me
connecting to a db does not imply expanding the tree item.

- Running scripts that create metadata items leaves the tree in a
mish-mash of expanded and collapsed nodes, depending on some internal
observer updates.

How about we leave the platform-specific behaviour[1] in place, and get
out of that business (tree item expansion) altogether?  I would
definitely prefer that.

[1] Expansion on double click seems foreign at least on Mac OS X, maybe
on GTK too.

Thanks

--
Michael Hieke



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Flamerobin-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/flamerobin-devel
Reply | Threaded
Open this post in threaded view
|

Re: Automatic tree item expansion

Milan Babuskov-5
Michael Hieke wrote:
> how do you feel about automatic expanding tree items?

I have a mix of feelings. Here's the behavior I'd like to see, but
failed to make it work so far:

1. database and table/view/SP nodes

Double-click or [Enter] on database connects the disconnected database.
With tables/views/SPs it loads and shows columns if not loaded already
(this depends on config setting, of course).

It also expands/contracts the node (toggle expanded state)

2. other nodes

Double-click or enter expands/contracts the node (toggle expanded state)


> - Connecting to a database with pressing [Enter] expands and collapses
> the tree item.  That causes flicker, and looks downright ugly when
> animation effects are enabled.

It's a bug. I thought it was fixed (IIRC, it did work correctly when we
were using wx2.4). The bottom line is: ENTER and double-click should do
the same.

> - Connecting to a database with double click expands, collapses and
> expands the tree item.

The problem is: native MSW tree control toggles the tree after
double-click no matter what you do. IIRC, the control also behaves
differently depending on the state before double-click (did it have
children nodes or not).

Here's what happens: double-click calls stuff in observer pattern, it
adds nodes and expands tree. Since native control would toggle its
state, we have to collapse to trick it. So, the current behavior is
already a hack.

> - Running scripts that create metadata items leaves the tree in a
> mish-mash of expanded and collapsed nodes, depending on some internal
> observer updates.

True.

> How about we leave the platform-specific behaviour[1] in place, and get
> out of that business (tree item expansion) altogether?  I would
> definitely prefer that.

Could you first remove the code, and try how it works. If it works fine,
I'm all for it.

> [1] Expansion on double click seems foreign at least on Mac OS X, maybe
> on GTK too.

AFAIK, there is no native tree control on GTK, all apps. implement
behavior as the see fit. I explained the behavior I'd like to see above.

--
Milan Babuskov
http://njam.sourceforge.net
http://www.flamerobin.org



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Flamerobin-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/flamerobin-devel
Reply | Threaded
Open this post in threaded view
|

Re: Automatic tree item expansion

Michael Hieke
Milan,

Milan Babuskov wrote:

> I have a mix of feelings. Here's the behavior I'd like to see, but
> failed to make it work so far:
>
> 1. database and table/view/SP nodes
>
> Double-click or [Enter] on database connects the disconnected
> database. With tables/views/SPs it loads and shows columns if not
> loaded already (this depends on config setting, of course).

That works.

>> - Connecting to a database with pressing [Enter] expands and
>> collapses the tree item.  That causes flicker, and looks downright
>> ugly when animation effects are enabled.
>
> It's a bug. I thought it was fixed (IIRC, it did work correctly when
> we were using wx2.4). The bottom line is: ENTER and double-click
> should do the same.

This is where we differ.  ENTER and double-click execute the default
action, but for the expanding and collapsing behaviour the tree should
IMO obey system defaults:

- wxMSW: Double-click expands or collapses, while ENTER does not.  Same
as Explorer tree does it.
- wxGTK: Don't know.
- wxMAC: Neither double-click nor ENTER expand or collapse.

> The problem is: native MSW tree control toggles the tree after
> double-click no matter what you do.

Well, since it does that we shouldn't mess with it.  Preserve
platform-native behaviour as much as possible.

> IIRC, the control also behaves differently depending on the state
> before double-click (did it have children nodes or not).

Yes, I remember this from Delphi program.  I fixed it by setting a node
to collapsed when all its children were deleted.  Maybe it's worth a try?

> Here's what happens: double-click calls stuff in observer pattern, it
> adds nodes and expands tree. Since native control would toggle its
> state, we have to collapse to trick it. So, the current behavior is
> already a hack.

Indeed.  It all comes down to this: Do we want native behaviour, or do
we want consistent behaviour between platforms?  I have stated my
preference, if I wanted consistent but non-native, I would probably use QT.

> AFAIK, there is no native tree control on GTK, all apps. implement
> behavior as the see fit. I explained the behavior I'd like to see
> above.

I really lack the experience with GTK apps.

Any opinion from interested third parties?  What behaviour would you
like to see?

Thanks

--
Michael Hieke



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Flamerobin-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/flamerobin-devel
Reply | Threaded
Open this post in threaded view
|

Re: Automatic tree item expansion

Milan Babuskov-5
Michael Hieke wrote:

>> The bottom line is: ENTER and double-click
>> should do the same.
>
> This is where we differ.  ENTER and double-click execute the default
> action, but for the expanding and collapsing behaviour the tree should
> IMO obey system defaults:
>
> - wxMSW: Double-click expands or collapses, while ENTER does not.  Same
> as Explorer tree does it.
> - wxGTK: Don't know.
> - wxMAC: Neither double-click nor ENTER expand or collapse.

Well... ok.

>> IIRC, the control also behaves differently depending on the state
>> before double-click (did it have children nodes or not).
>
> Yes, I remember this from Delphi program.  I fixed it by setting a node
> to collapsed when all its children were deleted.  Maybe it's worth a try?

I didn't try to approach the problem from that angle. It might help.

> Indeed.  It all comes down to this: Do we want native behaviour, or do
> we want consistent behaviour between platforms?  I have stated my
> preference, if I wanted consistent but non-native, I would probably use QT.

I'm fine with native behavior. I'll test some GTK apps that have trees
and report my findings here (Gnome HIG doesn't say anything on this topic).

--
Milan Babuskov
http://njam.sourceforge.net
http://www.flamerobin.org



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Flamerobin-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/flamerobin-devel
Reply | Threaded
Open this post in threaded view
|

Re: Automatic tree item expansion

Milan Babuskov-5
Milan Babuskov wrote:
> I'm fine with native behavior. I'll test some GTK apps that have trees
> and report my findings here (Gnome HIG doesn't say anything on this topic).

Well, Gtk apps try their best to use list boxes instead of tree control.
I only managed to find few, and (to make it short) - there is no
standard. We have three types:

1. don't handle double click or Enter at all. I click, or push Enter and
nothing happens. The only way to collapse the tree is the that small
triangle (equivallent to small box with + sign on Windows), and
sometimes + and - keys on numeric keyboard. Typical representative:
Evolution (email client, similar to MS Outlook).

2. only expand, but don't collapse. I.e. double-click on expanded item
does nothing. This one is used by Blusfish html editor for example.

3. Both expand and collapse on double-click/Enter. This one is used by
GConf, a GUI for Gnome configuration.


All three approaches have one thing in common: they work (or don't work)
completely the same with double-click or Enter. I'd prefer that we use
approach 3, as hunting down little triangles with mouse simply sucks.

--
Milan Babuskov
http://njam.sourceforge.net
http://www.flamerobin.org



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Flamerobin-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/flamerobin-devel
Reply | Threaded
Open this post in threaded view
|

Re: Automatic tree item expansion

Michael Hieke-2
In reply to this post by Milan Babuskov-5
Milan,

Milan Babuskov wrote:

>>> IIRC, the control also behaves differently depending on the state
>>>  before double-click (did it have children nodes or not).
>>
>> Yes, I remember this from Delphi program.  I fixed it by setting a
>> node to collapsed when all its children were deleted.  Maybe it's
>> worth a try?

That did the trick.  With that fix, and all code to expand and collapse
tree items removed, now the tree control works beautifully on wxMSW.

I only need to find a nice way to make the nodes expand and collapse in
wxGTK.  Will commit if/when I get everything to work correctly.

Thanks

--
Michael Hieke



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Flamerobin-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/flamerobin-devel
Reply | Threaded
Open this post in threaded view
|

Re: Automatic tree item expansion

Milan Babuskov-5
Michael Hieke wrote:
> I only need to find a nice way to make the nodes expand and collapse in
> wxGTK.  Will commit if/when I get everything to work correctly.

It seems to work perfectly now with GTK2.

--
Milan Babuskov
http://njam.sourceforge.net
http://www.flamerobin.org



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Flamerobin-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/flamerobin-devel