Change Treeview bitmap at runtime

Change Treeview bitmap at runtime

Postby Maurilio Viana » Fri Sep 15, 2006 2:19 pm

Hi!

I'm trying to implement a control access menu based in SysTreeView32.
I want to check/uncheck menu items that the user can or not access.

Code: Select all  Expand view  RUN
{-}--Menu 1
|     |---[ ] Menu 1.1
|     |---[x] Menu 1.2
|     +---[ ] Menu 1.3
|
{-}--Menu 2
       |---[x] Menu 2.1
       +---[x] Menu 2.2


Using TreeView I did any like this and I will use a bitmap to checked and other to unchecked state.

1. How can I change bitmap when we click over?
2. How can I know if a item is checked or not to save the results in a database?

Best regards,
Maurilio[/img]
User avatar
Maurilio Viana
 
Posts: 252
Joined: Tue Oct 25, 2005 2:48 pm
Location: Garça/Garza/Heron City - Brazil

Postby James Bott » Fri Sep 15, 2006 3:22 pm

Although not as fancy, a browse would be much easier to program.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Change Treeview bitmap at runtime

Postby Enrico Maria Giordano » Fri Sep 15, 2006 3:40 pm

Maurilio Viana wrote:1. How can I change bitmap when we click over?


Try to change the image in the oImageList and then use SetImageList() method.

Maurilio Viana wrote:2. How can I know if a item is checked or not to save the results in a database?


Store the info in an array or a database and toggle it when you click on a tree item.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Maurizio » Fri Sep 15, 2006 4:24 pm

Maurilio

From the oImageList


IF oItem:nImage = 1
oItem:Set( ,2)
oItem:nImage := 2
ELSE
oItem:Set( ,1)
oItem:nImage := 1
ENDIF

Regards Maurizio
User avatar
Maurizio
 
Posts: 825
Joined: Mon Oct 10, 2005 1:29 pm

Postby Rossine » Fri Sep 15, 2006 7:27 pm

Olá Maurilio beleza :D

O que você precisa seia algo como a imagem abaixo ?

Image

Abraços,

Rossine.
Rossine
 
Posts: 344
Joined: Tue Oct 11, 2005 11:33 am

Postby Maurilio Viana » Fri Sep 15, 2006 8:33 pm

Rossine wrote:O que você precisa seia algo como a imagem abaixo ?


Isso mesmo, Rossine!

[ ]'s
Maurilio
User avatar
Maurilio Viana
 
Posts: 252
Joined: Tue Oct 25, 2005 2:48 pm
Location: Garça/Garza/Heron City - Brazil

Postby Rossine » Sat Sep 16, 2006 12:29 pm

Olá Maurilio,

Se eu não estou enganado eu peguei este exemplo aqui mesmo :lol:

http://geocities.yahoo.com.br/qiinformatica2000/tree.zip

Este exemplo tem vários recursos:

- Mudar a cor do fundo
- Mudar o label das opções ( Basta clicar duas vezes emcima delas)
- Opção para acionar um calendário
- Mudar o bitmap ao clicar duas vezes, etc...

Espero que te ajude :wink:

Abraços,

Rossine.
Rossine
 
Posts: 344
Joined: Tue Oct 11, 2005 11:33 am

Postby Silvio » Sat Sep 16, 2006 4:43 pm

where is the ch files ?
---------------
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Postby Maurilio Viana » Mon Sep 18, 2006 11:05 am

Rossine wrote:Se eu não estou enganado eu peguei este exemplo aqui mesmo :lol:
http://geocities.yahoo.com.br/qiinformatica2000/tree.zip


Obrigado, Rossine!
Vou testar. Eu estava apanhando, pois eu estava tentando montar como um browse e estava horrivel, o treeview tem opcao de esconder os sub-itens...

[ ]'s
Maurilio
User avatar
Maurilio Viana
 
Posts: 252
Joined: Tue Oct 25, 2005 2:48 pm
Location: Garça/Garza/Heron City - Brazil


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 47 guests