Are there any Treeview samples with associated edit boxes?

User avatar
RAMESHBABU
Posts: 668
Joined: Fri Oct 21, 2005 5:54 am
Location: Secunderabad (T.S), India
Been thanked: 11 times

Re: Are there any Treeview samples with associated edit boxes?

Post by RAMESHBABU »

Dear Antonio,

I am trying to incorporate 'PIM.PRG' in my application.
Some parts of the PIM.PRG are not working when I add PIM
in my main project. But as a independent sample, it is working
fine.

The following oTree:bChanged line is not working at all:

oTree:bChanged = { | oItem | oItem := oTree:GetSelected(),;
if( oItem != nil, ;
if( !Empty( oItem:Cargo ), ;
oMemo:LoadRTF( oItem:Cargo, !oMemo:IsTextRtf( oItem:Cargo ) ), ;
oMemo:SetText( "" ) ), oMemo:SetText( "" ) ) }

and also I am not able to edited the text of a node with the following function:

function TreeEditItem( oTree )

local oItem := oTree:GetSelected()

if oItem != nil
PostMessage( oTree:hWnd, TVM_EDITLABEL, 0, oItem:hItem )
endif

return nil

I don't know why it is not working when I include pim in my project.
Please advise me.

Regards,

-Ramesh Babu

User avatar
Antonio Linares
Site Admin
Posts: 44508
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 717 times
Been thanked: 311 times
Contact:

Re: Are there any Treeview samples with associated edit boxes?

Post by Antonio Linares »

Dear Ramesh,

pim.prg uses a manifest file from pim.rc

Does your app use a manifest too ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
RAMESHBABU
Posts: 668
Joined: Fri Oct 21, 2005 5:54 am
Location: Secunderabad (T.S), India
Been thanked: 11 times

Re: Are there any Treeview samples with associated edit boxes?

Post by RAMESHBABU »

Dear Antonio,

Thank you for your attention.

Does your app use a manifest too ?

Yes. 1 24 "WindowsXP.Manifest"

Ragards,

-Ramesh Babu

User avatar
Antonio Linares
Site Admin
Posts: 44508
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 717 times
Been thanked: 311 times
Contact:

Re: Are there any Treeview samples with associated edit boxes?

Post by Antonio Linares »

Dear Ramesh,

Are you using a main MDI window ?

Are you using FW_SetUnicode( .T. ) in your app ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
Posts: 44508
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 717 times
Been thanked: 311 times
Contact:

Re: Are there any Treeview samples with associated edit boxes?

Post by Antonio Linares »

Fixed:

  • Fix: TreeView SelChanged not firing in Unicode mode (source\classes\window.prg,
    source\ceclasses\window.prg):
    When FW_SetUnicode(.T.) is active, the TreeView control sends TVN_SELCHANGEDW
    (-456) instead of TVN_SELCHANGEDA (-402). The Notify() handler only matched
    the ANSI code, so bChanged callbacks never fired in Unicode mode. Fixed: add
    TVN_SELCHANGEDW to the case condition alongside TVN_SELCHANGEDA.

Code: Select all | Expand

 #define TVN_SELCHANGEDA  -402  // CommCtrl TreeView notification
+#define TVN_SELCHANGEDW  -456  // CommCtrl TreeView notification (Unicode)

-         case nCode == 103 .or. nCode == TVN_SELCHANGEDA  // TreeView item selected
+         case nCode == 103 .or. nCode == TVN_SELCHANGEDA .or. nCode == TVN_SELCHANGEDW  // TreeView item selected
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
RAMESHBABU
Posts: 668
Joined: Fri Oct 21, 2005 5:54 am
Location: Secunderabad (T.S), India
Been thanked: 11 times

Re: Are there any Treeview samples with associated edit boxes?

Post by RAMESHBABU »

Dear Antonio,
Thank you very much for your support.
I will test and let you know the result.

Temporarily I commented out FW_SetUnicode(.T.) .
before your new post and the text attached to the nodes are properly displaying.

With your suggested changes, editing node text will work?

Regards,

  • Ramesh Babu
User avatar
Antonio Linares
Site Admin
Posts: 44508
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 717 times
Been thanked: 311 times
Contact:

Re: Are there any Treeview samples with associated edit boxes?

Post by Antonio Linares »

Yes, they should work

regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply