Sign in to follow this  
Followers 0
czardas

TreeView vs ListView + Checkboxes

5 posts in this topic

#1 ·  Posted (edited)

I have been pondering whether to use TreeView with $TVS_CHECKBOXES, as demonstrated in the GUI example folder, or ListView using $LVS_EX_CHECKBOXES. Although both of these controls have much more functionality than I require, I prefer the TreeView, for several reasons. The only thing that bugs me is that I only want the checkboxes to be ticked without the item being selected (visually), as is the case with ListView. I don't seem to be able to find any method to do this, apart from forcing the control to lose focus, which is less than pretty. Is it possible to never show the selection, and only tick the box?

Check the example in C:\Program Files\AutoIt3\Examples\GUISampleControls.au3

Really ListView is more appropriate for my purpose, but I'm not sure if I will use it. Perhaps I should not use either. I may end up custom designing the style of control I want by using an embeded GUI with a scroll bar and separate check boxes. Although I already have three embedded GUI's. Also, I'm not sure if the method will work on a Tab, but I can try. [Doesn't work!] Gosh - one whole week just to design this one control (although most of the time was spent defining the control's contents, and fighting with the background colour of the Tabs). :)

Maybe that's not so clear. :idiot:

Now I have discovered that embedding a GUI on a Tab control doesn't seem to work, because it appears on all Tabs. The reason for my dilema is that ListView truncates long words, even though there's enough (although limited) space, it also adds a gap at the end of the list (which I don't like) and it doesn't seem to format the line height to the same proportions as TreeView even with the same font. That's three strikes and you're out!

Well I suppose it's a tough question. If it's not possible to just tick the box in a TreeView control, then I guess I'll just have to rethink my design. The highlighted selection isn't really so bad. ;)

Edited by czardas

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Now I have discovered that embedding a GUI on a Tab control doesn't seem to work, because it appears on all Tabs.

You could probably hide the window when another tab is activated, and show when the right one is active. Edited by AdmiralAlkex

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

You could probably hide the window when another tab is activated, and show when the right one is active.

Thanks, I'll look into that idea. I'm not totally aquainted with the limitations of all the controls available. I guess there will always be someone (like me) who wants a special feature, or some particular customization options. I think part of the problem is when you are trying things out for the first time, you don't always make the right choices. Later on things can get quite complicated if the design needs to be altered. In this case I seem to have wandered into that territory a little. It's not the first time it's happened, and probably won't be the last.

The scary part is yet to come: connecting the front and back ends. :)

Edited by czardas

Share this post


Link to post
Share on other sites

czardas,

AdmiralAlkex has it right about the tabs (would you expect anything else! ;))

Could I recommend the Tabs tutorial in the Wiki - it shows you how to do what you want. :)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Thanks, I just took a quick look at the tutorial and I can see why I was having problems. It's quite interesting. I didn't have any problems creating standard controls on the tabs, only the custom GUI. I think it's something I may have to review later, since I still have several other controls to design. Once I know everything fits in place, I will replace the Tab controls.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0