Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Treeview - set different color for the entries

5 posts in Objects Last posting was on 2004-11-20 19:16:04.0Z
M.Erlinger Posted on 2004-11-19 15:38:26.0Z
Reply-To: "M.Erlinger" <michael.erlinger@erlinger-software.at>
From: "M.Erlinger" <michael.erlinger@erlinger-software.at>
Newsgroups: sybase.public.powerbuilder.objects
Subject: Treeview - set different color for the entries
Lines: 10
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 62.212.169.105
X-Original-NNTP-Posting-Host: 62.212.169.105
Message-ID: <419e1372@forums-1-dub>
Date: 19 Nov 2004 07:38:26 -0800
X-Trace: forums-1-dub 1100878706 62.212.169.105 (19 Nov 2004 07:38:26 -0800)
X-Original-Trace: 19 Nov 2004 07:38:26 -0800, 62.212.169.105
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:8100
Article PK: 735367

hello

how could i set different colors for the treeview-entries??
( like outlook-express newsgroup-reader; if a marked newsgroup-entry have a
new answer, then is the newsgroup-color red)

thank's in advance for any clues
Michael E.


Roy Kiesler [TeamSybase] Posted on 2004-11-19 16:18:27.0Z
From: "Roy Kiesler [TeamSybase]" <roy.kiesler@teamsybase.com>
Reply-To: SPAM_FRE_roy.kiesler@teamsybase.com
Organization: TeamSybase
User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: sybase.public.powerbuilder.objects
Subject: Re: Treeview - set different color for the entries
References: <419e1372@forums-1-dub>
In-Reply-To: <419e1372@forums-1-dub>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: c-24-4-133-16.client.comcast.net
X-Original-NNTP-Posting-Host: c-24-4-133-16.client.comcast.net
Message-ID: <419e1cd3$1@forums-1-dub>
Date: 19 Nov 2004 08:18:27 -0800
X-Trace: forums-1-dub 1100881107 24.4.133.16 (19 Nov 2004 08:18:27 -0800)
X-Original-Trace: 19 Nov 2004 08:18:27 -0800, c-24-4-133-16.client.comcast.net
Lines: 18
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:8101
Article PK: 735370


M.Erlinger wrote:
> hello
>
> how could i set different colors for the treeview-entries??
> ( like outlook-express newsgroup-reader; if a marked newsgroup-entry have a
> new answer, then is the newsgroup-color red)
>
> thank's in advance for any clues
> Michael E.
>
>

If you are using PB9 or later, you can do that w/ PBNI. Check out the
example at
http://powerbuilder.codexchange.sybase.com/files/documents/67/1127/CustomDraw.zip

--
Roy


M.Erlinger Posted on 2004-11-19 21:22:54.0Z
Reply-To: "M.Erlinger" <michael.erlinger@erlinger-software.at>
From: "M.Erlinger" <michael.erlinger@erlinger-software.at>
Newsgroups: sybase.public.powerbuilder.objects
References: <419e1372@forums-1-dub> <419e1cd3$1@forums-1-dub>
Subject: Re: Treeview - set different color for the entries
Lines: 30
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 62.212.169.105
X-Original-NNTP-Posting-Host: 62.212.169.105
Message-ID: <419e642e@forums-1-dub>
Date: 19 Nov 2004 13:22:54 -0800
X-Trace: forums-1-dub 1100899374 62.212.169.105 (19 Nov 2004 13:22:54 -0800)
X-Original-Trace: 19 Nov 2004 13:22:54 -0800, 62.212.169.105
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:8102
Article PK: 735368

Thank's for show this example, but i don't know how to use this example for
my requirement??

i would like to set some items in a treeview (during the insertItem...) to
red dependant from any criteria of the data.





"Roy Kiesler [TeamSybase]" <roy.kiesler@teamsybase.com> schrieb im
Newsbeitrag news:419e1cd3$1@forums-1-dub...

> M.Erlinger wrote:
>> hello
>>
>> how could i set different colors for the treeview-entries??
>> ( like outlook-express newsgroup-reader; if a marked newsgroup-entry have
>> a new answer, then is the newsgroup-color red)
>>
>> thank's in advance for any clues
>> Michael E.
>
> If you are using PB9 or later, you can do that w/ PBNI. Check out the
> example at
> http://powerbuilder.codexchange.sybase.com/files/documents/67/1127/CustomDraw.zip
>
> --
> Roy


Roy Kiesler [TeamSybase] Posted on 2004-11-20 18:58:01.0Z
From: "Roy Kiesler [TeamSybase]" <roy.kiesler@teamsybase.com>
Reply-To: SPAM_FRE_roy.kiesler@teamsybase.com
Organization: TeamSybase
User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: sybase.public.powerbuilder.objects
Subject: Re: Treeview - set different color for the entries
References: <419e1372@forums-1-dub> <419e1cd3$1@forums-1-dub> <419e642e@forums-1-dub>
In-Reply-To: <419e642e@forums-1-dub>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: c-24-4-133-16.client.comcast.net
X-Original-NNTP-Posting-Host: c-24-4-133-16.client.comcast.net
Message-ID: <419f93b9$1@forums-1-dub>
Date: 20 Nov 2004 10:58:01 -0800
X-Trace: forums-1-dub 1100977081 24.4.133.16 (20 Nov 2004 10:58:01 -0800)
X-Original-Trace: 20 Nov 2004 10:58:01 -0800, c-24-4-133-16.client.comcast.net
Lines: 58
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:8104
Article PK: 735372

That's what the C++ code is there for -- if you take a look at the
CCustomDrawHelper::TVLoadItems( PBCallInfo * ci ) method, you'll see
that it is simply invoking the of_InsertItem() method on the tv_html
user object.

The of_InsertItem takes two arguments, label and color. The color
parameter is then stored in the .data attribute of the TreeViewItem. The
rest is taken care of by the custom draw code.

So... in your case, you can simply create additional "wrappers" for the
trreview methods (InsertItemFirst/Last, etc.) that take an extra
parameter (color), and just set the .data attribute of the respective
TreeViewItem.

Final note: the C++ implementation displays the HTML value of the color
(#RRGGBB) next to the label. Commenting out the following 2 lines should
remove that effect when you re-compile the C++ source:

DrawText(pNMTVCD->nmcd.hdc, _szClrTag[colorIndex], -1, &rc, DT_LEFT);
SetTextColor(pNMTVCD->nmcd.hdc, nOldClr);

--
Roy

M.Erlinger wrote:
> Thank's for show this example, but i don't know how to use this example for
> my requirement??
>
> i would like to set some items in a treeview (during the insertItem...) to
> red dependant from any criteria of the data.
>
>
>
>
>
> "Roy Kiesler [TeamSybase]" <roy.kiesler@teamsybase.com> schrieb im
> Newsbeitrag news:419e1cd3$1@forums-1-dub...
>
>>M.Erlinger wrote:
>>
>>>hello
>>>
>>>how could i set different colors for the treeview-entries??
>>>( like outlook-express newsgroup-reader; if a marked newsgroup-entry have
>>>a new answer, then is the newsgroup-color red)
>>>
>>>thank's in advance for any clues
>>>Michael E.
>>
>>If you are using PB9 or later, you can do that w/ PBNI. Check out the
>>example at
>>http://powerbuilder.codexchange.sybase.com/files/documents/67/1127/CustomDraw.zip
>>
>>--
>>Roy
>
>
>


M.Erlinger Posted on 2004-11-20 19:16:04.0Z
Reply-To: "M.Erlinger" <michael.erlinger@erlinger-software.at>
From: "M.Erlinger" <michael.erlinger@erlinger-software.at>
Newsgroups: sybase.public.powerbuilder.objects
References: <419e1372@forums-1-dub> <419e1cd3$1@forums-1-dub> <419e642e@forums-1-dub> <419f93b9$1@forums-1-dub>
Subject: Re: Treeview - set different color for the entries
Lines: 62
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 62.212.169.105
X-Original-NNTP-Posting-Host: 62.212.169.105
Message-ID: <419f97f4@forums-1-dub>
Date: 20 Nov 2004 11:16:04 -0800
X-Trace: forums-1-dub 1100978164 62.212.169.105 (20 Nov 2004 11:16:04 -0800)
X-Original-Trace: 20 Nov 2004 11:16:04 -0800, 62.212.169.105
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:8105
Article PK: 735373

O.K. - now i understand it !! - thank's.
Michael

"Roy Kiesler [TeamSybase]" <roy.kiesler@teamsybase.com> schrieb im
Newsbeitrag news:419f93b9$1@forums-1-dub...

> That's what the C++ code is there for -- if you take a look at the
> CCustomDrawHelper::TVLoadItems( PBCallInfo * ci ) method, you'll see that
> it is simply invoking the of_InsertItem() method on the tv_html user
> object.
>
> The of_InsertItem takes two arguments, label and color. The color
> parameter is then stored in the .data attribute of the TreeViewItem. The
> rest is taken care of by the custom draw code.
>
> So... in your case, you can simply create additional "wrappers" for the
> trreview methods (InsertItemFirst/Last, etc.) that take an extra parameter
> (color), and just set the .data attribute of the respective TreeViewItem.
>
> Final note: the C++ implementation displays the HTML value of the color
> (#RRGGBB) next to the label. Commenting out the following 2 lines should
> remove that effect when you re-compile the C++ source:
>
> DrawText(pNMTVCD->nmcd.hdc, _szClrTag[colorIndex], -1, &rc, DT_LEFT);
> SetTextColor(pNMTVCD->nmcd.hdc, nOldClr);
>
> --
> Roy
>
> M.Erlinger wrote:
>> Thank's for show this example, but i don't know how to use this example
>> for my requirement??
>>
>> i would like to set some items in a treeview (during the insertItem...)
>> to red dependant from any criteria of the data.
>>
>>
>>
>>
>>
>> "Roy Kiesler [TeamSybase]" <roy.kiesler@teamsybase.com> schrieb im
>> Newsbeitrag news:419e1cd3$1@forums-1-dub...
>>
>>>M.Erlinger wrote:
>>>
>>>>hello
>>>>
>>>>how could i set different colors for the treeview-entries??
>>>>( like outlook-express newsgroup-reader; if a marked newsgroup-entry
>>>>have a new answer, then is the newsgroup-color red)
>>>>
>>>>thank's in advance for any clues
>>>>Michael E.
>>>
>>>If you are using PB9 or later, you can do that w/ PBNI. Check out the
>>>example at
>>>http://powerbuilder.codexchange.sybase.com/files/documents/67/1127/CustomDraw.zip
>>>
>>>--
>>>Roy
>>
>>