TreeView Problem (SOLVED)

TreeView Problem (SOLVED)

Postby Horizon » Sun Apr 14, 2013 6:18 pm

Hi

I have a problem with TreeView. First of all, this is not new. it was the same in fwh 1204.

This problem occurs treeview in folderx. The sample is below. this sample expands all items. if you change vertical scrollbar, treeview items mixed.

Any comments?

Thanks.

Image

Code: Select all  Expand view
// Using a TreeView with checkboxes and checking their status

#include "FiveWin.ch"

function Main()

   local oDlg, oTree

   DEFINE DIALOG oDlg SIZE 400, 300

  @ 2, 3 FOLDERex oFld OF oDlg PIXEL ;
      PROMPTS "&Folder1", "F&older2","Fo&lder3";
      ROUND 10

    @ 0,0 TREEVIEW oTree OF oFld:aDialogs[1] SIZE 195, 130 PIXEL

   ACTIVATE DIALOG oDlg CENTERED ON INIT BuildTree( oTree )

return nil

function BuildTree( oTree )

   local oItem

   oItem := oTree:Add( "Main.Item1" )
      oItem:Add( "Detail.Item1..." )
      oItem:Add( "Detail.Item2..." )
      oItem:Add( "Detail.Item3..." )
      oItem:Add( "Detail.Item4..." )
      oItem:Add( "Detail.Item5..." )
      oItem:Add( "Detail.Item6..." )

   oItem:= oTree:Add( "Main.Item2" )
      oItem:Add( "Detail.Item1..." )
      oItem:Add( "Detail.Item2..." )
      oItem:Add( "Detail.Item3..." )
      oItem:Add( "Detail.Item4..." )
      oItem:Add( "Detail.Item5..." )
      oItem:Add( "Detail.Item6..." )

   oItem := oTree:Add( "Main.Item3" )
      oItem1 := oItem:Add( "Detail.Item1..." )
        oItem1:Add( "Detailmmm.Item1..." )
        oItem1:Add( "Detailmmm.Item2..." )
      oItem1 := oItem:Add( "Detail.Item2..." )
        oItem1:Add( "Detailmmm.Item3..." )
        oItem1:Add( "Detailmmm.Item4..." )
      oItem1 := oItem:Add( "Detail.Item3..." )
        oItem1:Add( "Detailmmm.Item5..." )
        oItem1:Add( "Detailmmm.Item6..." )
      oItem1 := oItem:Add( "Detail.Item4..." )
        oItem1:Add( "Detailmmm.Item7..." )
        oItem1:Add( "Detailmmm.Item8..." )
      oItem1 := oItem:Add( "Detail.Item5..." )
        oItem1:Add( "Detailmmm.Item9..." )
        oItem1:Add( "Detailmmm.Item10..." )
      oItem1 := oItem:Add( "Detail.Item6..." )
        oItem1:Add( "Detailmmm.Item11..." )
        oItem1:Add( "Detailmmm.Item12..." )
      oItem1 := oItem:Add( "Detail.Item7..." )
        oItem1:Add( "Detailmmm.Item13..." )
        oItem1:Add( "Detailmmm.Item14..." )
      oItem1 := oItem:Add( "Detail.Item8..." )
        oItem1:Add( "Detailmmm.Item15..." )
        oItem1:Add( "Detailmmm.Item16..." )
      oItem1 := oItem:Add( "Detail.Item9..." )
        oItem1:Add( "Detailmmm.Item17..." )
        oItem1:Add( "Detailmmm.Item18..." )
      oItem1 := oItem:Add( "Detail.Item10..." )
        oItem1:Add( "Detailmmm.Item19..." )
        oItem1:Add( "Detailmmm.Item20..." )
      oItem1 := oItem:Add( "Detail.Item11..." )
        oItem1:Add( "Detailmmm.Item21..." )
        oItem1:Add( "Detailmmm.Item1..." )
      oItem1 := oItem:Add( "Detail.Item12..." )
        oItem1:Add( "Detailmmm.Item22..." )
        oItem1:Add( "Detailmmm.Item23..." )
      oItem1 := oItem:Add( "Detail.Item13..." )
        oItem1:Add( "Detailmmm.Item24..." )
        oItem1:Add( "Detailmmm.Item25..." )

   oTree:ExpandAll()


return nil
 
Last edited by Horizon on Tue Apr 16, 2013 10:51 am, edited 1 time in total.
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1297
Joined: Fri May 23, 2008 1:33 pm

Re: TreeView Problem.

Postby Horizon » Mon Apr 15, 2013 7:37 am

Antonio?
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1297
Joined: Fri May 23, 2008 1:33 pm

Re: TreeView Problem.

Postby Antonio Linares » Mon Apr 15, 2013 8:53 am

Hakan,

Have yoy tried to refresh the treeview ? If that solves the problem. Then we should try to fire it automatically
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41449
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: TreeView Problem.

Postby Horizon » Mon Apr 15, 2013 9:37 am

Hi Antonio,

Where should i put refresh. Which method should use?

Thanks
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1297
Joined: Fri May 23, 2008 1:33 pm

Re: TreeView Problem.

Postby Antonio Linares » Mon Apr 15, 2013 10:03 am

Hakan,

These changes are required in Class TTreeView Method New(): (fwh\source\classes\ttreevie.prg)

line 168: (added the styles CS_VREDRAW and CS_HREDRAW)
Code: Select all  Expand view
  ::nStyle    = nOR( WS_CHILD, WS_VISIBLE, CS_VREDRAW, CS_HREDRAW,;
                      If( lDesign, WS_CLIPSIBLINGS, 0 ), WS_TABSTOP,;
                      TVS_HASBUTTONS, TVS_HASLINES, TVS_LINESATROOT, TVS_SHOWSELALWAYS, TVS_DISABLEDRAGDROP,;
                      If( lCheckBoxes, TVS_CHECKBOXES, 0 ) )
 
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41449
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: TreeView Problem.

Postby Horizon » Mon Apr 15, 2013 11:07 am

Hi Antonio,

I have changed the ttreevie.prg and put this prg to my make file and compile, but there is no change.
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1297
Joined: Fri May 23, 2008 1:33 pm

Re: TreeView Problem.

Postby Antonio Linares » Mon Apr 15, 2013 2:25 pm

Hakan,

Here it seems to be working fine. Please test my EXE on your computer, thanks:

https://code.google.com/p/fivewin-contributions/downloads/detail?name=hakan.zip
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41449
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: TreeView Problem.

Postby Horizon » Mon Apr 15, 2013 3:04 pm

Antonio Linares wrote:Hakan,

Here it seems to be working fine. Please test my EXE on your computer, thanks:

https://code.google.com/p/fivewin-contributions/downloads/detail?name=hakan.zip


Antonio,

There is also problem in your exe. I have tested my win 7 64x and XP.

Please slide the vertical bar bottom side and top side.

Thanks
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1297
Joined: Fri May 23, 2008 1:33 pm

Re: TreeView Problem.

Postby Antonio Linares » Mon Apr 15, 2013 6:33 pm

Hakan,

This is not a perfect solution but it helps:

METHOD VScroll( nWParam, nLParam ) INLINE ::oWnd:Refresh(), nil

in Class TTreeView
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41449
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: TreeView Problem.

Postby Horizon » Mon Apr 15, 2013 7:12 pm

Antonio Linares wrote:Hakan,

This is not a perfect solution but it helps:

METHOD VScroll( nWParam, nLParam ) INLINE ::oWnd:Refresh(), nil

in Class TTreeView


Antonio,

Unfortuanely, it does not work.

Thanks.
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1297
Joined: Fri May 23, 2008 1:33 pm

Re: TreeView Problem.

Postby Antonio Linares » Mon Apr 15, 2013 7:46 pm

Hakan,

When you release the mouse on the vertical scrollbar, it should repaint it properly. Here it works
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41449
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: TreeView Problem.

Postby Horizon » Mon Apr 15, 2013 8:15 pm

Antonio,

You are right. When i released the button, it refresh. but it is not suitable for customers.

Why does not refresh the ttreeview in folder/x class? I could not understand it.

Thanks again.
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1297
Joined: Fri May 23, 2008 1:33 pm

Re: TreeView Problem.

Postby Antonio Linares » Mon Apr 15, 2013 9:34 pm

Hakan,

In tfoldex.prg line 347 comment this line:

// oDlg:lTransparent := .T.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41449
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: TreeView Problem.

Postby Horizon » Tue Apr 16, 2013 10:50 am

Hi Antonio,

It is ok now without changing anything in ttreevie.prg.
Will you change it next month fwh in tfolderx.prg?

Thanks.
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1297
Joined: Fri May 23, 2008 1:33 pm

Re: TreeView Problem (SOLVED)

Postby Antonio Linares » Tue Apr 16, 2013 10:52 am

Hakan,

Yes, it will be included in next FWH build, thanks :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41449
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 130 guests