Highlighting a card of a CardPresenter

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Highlighting a card of a CardPresenter

Sebastián Sastre
Hi all,

    I need to highlight (in some way) one card of a CardPresenter under
certain circunstances. The title of the tab can be set programatically to
bold?

    Any suggestion if it can't be done?

    best regards,


--
Sebastián Sastre
[hidden email]
www.seaswork.com.ar


Reply | Threaded
Open this post in threaded view
|

Re: Highlighting a card of a CardPresenter

Ian Bartholomew-18
Sebastián,

>     I need to highlight (in some way) one card of a CardPresenter
> under certain circunstances. The title of the tab can be set
> programatically to bold?

I think you may have to resort to "owner draw" or something like that.
I know (think) someone implemented that for ListViews so it may be
possible to port that to the TabView control

>     Any suggestion if it can't be done?

How about flagging the tab with an icon.  Demo ....

cp := Presenter show: 'Card container'.
(cp view addSubView: ContainerView new name: 'card1')
    arrangement: 'First'.
(cp view addSubView: ContainerView new name: 'card2')
    arrangement: 'Second'.
(cp view addSubView: ContainerView new name: 'card3')
    arrangement: 'Third'.

cp view tabs
    viewMode: #smallIcons;
    getImageBlock: [:i | i = 'Second' ifTrue: [10] ifFalse: [0]]

You'd would (obviously) need a better way of deciding which tab needed
highlighting but it shouldn't be too much of a problem (I think).

NB I just chose an icon (10) at random - there are better choices or you
might even want to add one of your own.

--
Ian

Use the Reply-To address to contact me.
Mail sent to the From address is ignored.


Reply | Threaded
Open this post in threaded view
|

Re: Highlighting a card of a CardPresenter

Chris Uppal-3
Ian, Sebastián,

> I think you may have to resort to "owner draw" or something like that.
> I know (think) someone implemented that for ListViews so it may be
> possible to port that to the TabView control

I believe that the the Windows 'owner draw' stuff for TabView (like list boxes,
combo boxes, buttons and menus) goes through a different mechanism from the
WM_NOTIFY/NM_CUSTOMDRAW that List View and Tree View use.  The List View custom
draw stuff is exposed in Dolphin, but the equivalent for TabView is not -- as
far as I can see (and it looks difficult too).

    -- chris