FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Change Treeview bitmap at runtime
Posts: 252
Joined: Tue Oct 25, 2005 02:48 PM
Change Treeview bitmap at runtime
Posted: Fri Sep 15, 2006 02: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.

{-}--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]
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Change Treeview bitmap at runtime
Posted: Fri Sep 15, 2006 03:22 PM

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

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Change Treeview bitmap at runtime
Posted: Fri Sep 15, 2006 03: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
Posts: 842
Joined: Mon Oct 10, 2005 01:29 PM
Change Treeview bitmap at runtime
Posted: Fri Sep 15, 2006 04: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

Posts: 344
Joined: Tue Oct 11, 2005 11:33 AM
Change Treeview bitmap at runtime
Posted: Fri Sep 15, 2006 07:27 PM
Olá Maurilio beleza :-)

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



Abraços,

Rossine.
Obrigado, Regards, Saludos



Rossine.



Harbour and Harbour++
Posts: 252
Joined: Tue Oct 25, 2005 02:48 PM
Change Treeview bitmap at runtime
Posted: Fri Sep 15, 2006 08:33 PM
Rossine wrote:
O que você precisa seia algo como a imagem abaixo ?


Isso mesmo, Rossine!

[ ]'s
Maurilio
Posts: 344
Joined: Tue Oct 11, 2005 11:33 AM
Change Treeview bitmap at runtime
Posted: Sat Sep 16, 2006 12:29 PM
Olá Maurilio,

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

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 :-)

Abraços,

Rossine.
Obrigado, Regards, Saludos



Rossine.



Harbour and Harbour++
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Change Treeview bitmap at runtime
Posted: Sat Sep 16, 2006 04:43 PM

where is the ch files ?

Best Regards, Saludos



Falconi Silvio
Posts: 252
Joined: Tue Oct 25, 2005 02:48 PM
Change Treeview bitmap at runtime
Posted: Mon Sep 18, 2006 11:05 AM
Rossine wrote:
Se eu não estou enganado eu peguei este exemplo aqui mesmo :-)
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

Continue the discussion