Always have list active without focus ring?

BlitzMax Forums/MaxGUI Module/Always have list active without focus ring?

ima747(Posted 2010) [#1]
Are either of these things possible: Always looking active even when it's not, and/or no focus ring on mac.

I have a list box that I would like to be able to have as the active element so that the selection will be clearly highlighted (instead of the greyed out highlight when another element is selected) preferably all the time. Regardless of weather it can be active all the time or not I would like to disable the focus ring on it.


SebHoll(Posted 2010) [#2]
Always looking active even when it's not

I had a quick look and can't find an obvious way to do this. I would guess that Apple wouldn't want you to bend their user interface conventions, so wouldn't make it easy for a non-active control to look active. Someone with better Cocoa knowledge might prove me wrong here, though.

I would like to disable the focus ring on it.

Now this we can do.

It seems if you pass NSFocusRingTypeNone to the listbox's NSView setFocusRingType: selector, you can disable the focus rectangle.

How's your Objective-C?


d-bug(Posted 2010) [#3]
Erm, Seb, you have to do it on the listboxs TableView (ListView->table) and on the TreeViews Outlineview (TreeView->outline). Doing it direktly on the ListView or the TreeView wouldn't disable the focusring. (Had to do it yesterday for CocoaExt :>)

I really don't know what I've done wrong, but when using CocoaExt all gadgets show their focusring and listbox, treeview ... look non-active, when they should. Maybe it has something to do with the second controller or something.


SebHoll(Posted 2010) [#4]
rm, Seb, you have to do it on the listboxs TableView (ListView->table) and on the TreeViews Outlineview (TreeView->outline). Doing it direktly on the ListView or the TreeView wouldn't disable the focusring. (Had to do it yesterday for CocoaExt :>)

Yep, sorry - I should have been clearer. That was what I meant by the listbox's NSView. Thanks for clarifying that.

I really don't know what I've done wrong, but when using CocoaExt all gadgets show their focusring and listbox, treeview ... look non-active, when they should. Maybe it has something to do with the second controller or something.

I'm not sure how your CocoaExt module hooks into the current Cocoa MaxGUI handler, but it may well be that.


ima747(Posted 2010) [#5]
hmmm. my objective-c is passable but all iPhone based and I wouldn't know where to start to integrate it with maxgui... Any tutorials I could get pointed to that might give me a starting point?

What's this about a cocoaext module? sounds like something I need to get friendly with...

Basically I'm trying to use a listbox to create the look of the left nav area in iPhoto. iPhoto uses a tree view technically, but I only need 1 list so that seemed like a bunch of extra coding... but there's no focus ring on the side bar area and regardless of what you do in the rest of the app your current section remains actively highlighted (like my listbox looks when it's got focus, rather than grey highlighted like my listbox looks when it looses focus).

Perhaps there's an easier way to go about it. I haven't poked a tree view yet, maybe that will take less hacking at...

oh, and it's cross platform, but there's no focus ring on windows so it's just the active highlight issue there... I've got some weird system beep on windows when interacting with the box too... but I assume it's me and haven't had time to look into it yet.


d-bug(Posted 2010) [#6]
I didn't expected an answer for the last part of my post. It's already okay as it is, since I've added the setFocusRingType method to my base gadget class in BlitzMax. :>

Feel free to download the repository and ask me via mail, if your really interested in it but it's not half that charming code you've provided in MaxGUI.


ima747(Posted 2010) [#7]
d-bug, just downloaded cocoaext. looks fantastic, can't wait to dig through it deeply. In the mean time however CocoaDisableFocusRing() doesn't seem to work for me.


d-bug(Posted 2010) [#8]
Arrgl, please wait until this evening. I haven't updated the repository with that fix. Sorry for that.

I don't know if CocoaExt is the right for you. It is mainly meant to be used in Cocoa applications only, so you have to do many directives if you want to keep your app cross-platform.


ima747(Posted 2010) [#9]
Well at the moment I just need to disable focus rings on about 5 gadgets on mac, and that's it, so it's a bit heavy for what I need but does exactly what I need, or rather it will as soon as that update goes live :0)

Thanks for the reply, I'll keep an eye on SVN. Can't wait to find time to dig a little deeper so I know what toys I have available for my next mac only project too.

Side note, I love DesktopExt as well, has saved me SO much time on this current project.


d-bug(Posted 2010) [#10]
Glad you like DesktopExt! :>
The fix is uploaded to the CocoaExt revision. Keep in mind, that it won't work for listboxes created with the MaxGUI creator function, since it needs a method which is in the TCocoaExtListBox subclass.


ima747(Posted 2010) [#11]
if I have to re-code one gadget as platform specific to get things to look pretty it's something I can easily live with :0)

downloading asap, thanks!

[edit]
installed, updated mac gadget creates to Cocoa versions and everything is beautiful. Thanks!
1 more query. Is there an easy way I can make the module only build for mac? I'm using MaxIDE Community Edition and brucey's cross compiler so I'm doing windows and mac builds in the same place. When I rebuild modules for PC it dies on cocoaext since, obvisouly, there's not really windows code in there... currently I just remove the module when building windows, was thinking I might go through and tag all the source with ?MacOS conditionals but I know I'll screw something up while I'm doing that...
[/edit]

[edit 2]
Wrapped the content of most of the files with ?MacOS to get the windows compile to quit whining at me. Let me know if you'd like me to email back to save time if you care.
[/edit 2]


d-bug(Posted 2010) [#12]
Oh, I should have done this a long time before. My fault! Didn't thought about cross-compiling modules. No need for a mail, I will do it this evening on my own. Thank you for reminding me. :>