fwh\samples\RE.prg - FiveWin Resources Editor underrated

Re: fwh\samples\RE.prg - FiveWin Resources Editor underrated

Postby Otto » Thu Sep 03, 2009 9:18 am

Hello Antonio,
yes.
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6364
Joined: Fri Oct 07, 2005 7:07 pm

Re: fwh\samples\RE.prg - FiveWin Resources Editor underrated

Postby Antonio Linares » Thu Sep 03, 2009 9:29 am

Otto,

When I use the modified RE.prg and click on the left tree, it shows the 4003 in the MsgInfo()

Where do you want it to be shown ? In the modificable dialogbox ? Inside the combobox ?
regards, saludos

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

Re: fwh\samples\RE.prg - FiveWin Resources Editor underrated

Postby James Bott » Thu Sep 03, 2009 11:22 am

Otto,

>The print out with the controls and id would be helpful for coding.

I still suggest considering using RC2PRG.PRG. Just modify it to generate the code style you want. This way to don't need to see the IDs, nor do you have to do any hand coding. Or, at least it gets you a generic version of the code, which you can then modify by hand to your liking.

It may take a little work to modify it, but it will prevent you from having to hand code all your dialogs from then on.

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

Re: fwh\samples\RE.prg - FiveWin Resources Editor underrated

Postby Otto » Thu Sep 03, 2009 11:52 am

Hello Antonio,

Here on the hardcopy of the dialog:
Best regards,
Otto

Image
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6364
Joined: Fri Oct 07, 2005 7:07 pm

Re: fwh\samples\RE.prg - FiveWin Resources Editor underrated

Postby Antonio Linares » Thu Sep 03, 2009 1:14 pm

Otto,

if it is an editable combobox, then it contains a child edit control, thats why you don't see the ID.

You have to locate the hWnd of the child edit:
Code: Select all  Expand view  RUN

hWndEdit = GetWindow( oCtrl:hWnd, GW_HWNDCHILD )
SetWindowText( hWndEdit, Str( nId ) )
 
regards, saludos

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

Re: fwh\samples\RE.prg - FiveWin Resources Editor underrated

Postby Otto » Thu Sep 03, 2009 3:58 pm

Hello Antonio,
I inserted the code into the InitControls function.
But how do I find out the nId. oCtrl:nId is empty?

Best regards,
Otto

Code: Select all  Expand view  RUN

function InitControls( oDlg )
   local hDlg := oDlg:hWnd, hCtrl := GetWindow( hDlg, GW_CHILD ), oCtrl
   local hWndEdit
   
   if hCtrl != 0
      oCtrl = TControl()
      oCtrl:oWnd = oDlg
      oCtrl:hWnd = hCtrl
      oCtrl:Link()
      AAdd( oDlg:aControls, oCtrl )
      oCtrl:lDrag = .T.
      oCtrl:bGotFocus = { || oCtrl:ShowDots() }
     
   endif


   while hCtrl != 0
      hCtrl = GetWindow( hCtrl, GW_HWNDNEXT )
      if hCtrl != 0
         oCtrl = TControl()
         oCtrl:oWnd = oDlg
         oCtrl:hWnd = hCtrl
       
hWndEdit = GetWindow( oCtrl:hWnd, GW_HWNDCHILD )
SetWindowText( hWndEdit, " ( oCtrl:nId )"  )  
         oCtrl:Link()
         
         oCtrl:lDrag = .T.
         oCtrl:bGotFocus = { || oCtrl:ShowDots() }
      endif
   end

return nil

//----------------------------------------------------------------------------//
 


Image
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6364
Joined: Fri Oct 07, 2005 7:07 pm

Re: fwh\samples\RE.prg - FiveWin Resources Editor underrated

Postby Antonio Linares » Thu Sep 03, 2009 5:25 pm

Otto,

GetWindowLong( hWndControl, GWL_ID ) --> nId

http://msdn.microsoft.com/en-us/library/ms633584(VS.85).aspx
regards, saludos

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

Re: fwh\samples\RE.prg - FiveWin Resources Editor underrated

Postby Otto » Thu Sep 03, 2009 8:37 pm

Hello Antonio,
thank you for your help.
Although I can’t find out how to get the nID of the combobox.
I tried to insert into InitControls function your code but the nID is 1001 and not 4003. I think I get the nID of the edit control and not of the combobox.
Best regards,
Otto


Code: Select all  Expand view  RUN
if hCtrl != 0
         oCtrl = TControl()
         oCtrl:oWnd = oDlg
         oCtrl:hWnd = hCtrl
       
        hWndEdit = GetWindow( oCtrl:hWnd, GW_HWNDCHILD )
       nID := GetWindowLong( hWndEdit,        GWL_ID )  
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6364
Joined: Fri Oct 07, 2005 7:07 pm

Re: fwh\samples\RE.prg - FiveWin Resources Editor underrated

Postby Antonio Linares » Thu Sep 03, 2009 9:34 pm

Otto,

This way:
Code: Select all  Expand view  RUN

    nID := GetWindowLong( oCtrl:hWnd, GWL_ID )  
 
regards, saludos

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

Re: fwh\samples\RE.prg - FiveWin Resources Editor underrated

Postby Otto » Fri Sep 04, 2009 6:33 am

Hello Antonio,
with

Code: Select all  Expand view  RUN

nID := GetWindowLong( oCtrl:hWnd, GWL_ID )  
msginfo( nID )     
 


nID is always 0.
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6364
Joined: Fri Oct 07, 2005 7:07 pm

Re: fwh\samples\RE.prg - FiveWin Resources Editor underrated

Postby Antonio Linares » Fri Sep 04, 2009 7:02 am

Otto,

Have you previously done this ?

oCtrl:hWnd = hCtrl

Please send me your most recent RE.prg and I will check it here, thanks :-)
regards, saludos

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

Re: fwh\samples\RE.prg - FiveWin Resources Editor underrated

Postby Antonio Linares » Fri Sep 04, 2009 10:02 am

Otto,

In function ParseControl( cLine ) make this change:

nId = Val( StrToken( cLine, 2, "," ) )

also change this section in function InitControls( oDlg ):
Code: Select all  Expand view  RUN

   ...
   while hCtrl != 0

      hCtrl = GetWindow( hCtrl, GW_HWNDNEXT )
   
      if hCtrl != 0
         oCtrl = TControl()
         oCtrl:oWnd = oDlg
         oCtrl:hWnd = hCtrl
       
         // Is it an editable combobox  
         if ( hWndEdit := GetWindow( oCtrl:hWnd, GW_HWNDCHILD ) ) != 0
            nID = GetWindowLong( oCtrl:hWnd, GWL_ID )  
            SetWindowText( hWndEdit, Str( nID ) )  
         endif
   
         oCtrl:Link()
         oCtrl:lDrag = .T.
         oCtrl:bGotFocus = { || oCtrl:ShowDots() }
      endif
   end

return nil
 

Here it works fine :-)
regards, saludos

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

Re: fwh\samples\RE.prg - FiveWin Resources Editor underrated

Postby Otto » Fri Sep 04, 2009 1:30 pm

Hello Antonio,

Here it works fine


Also here.
Thank you very much.
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6364
Joined: Fri Oct 07, 2005 7:07 pm

Re: fwh\samples\RE.prg - FiveWin Resources Editor underrated

Postby Antonio Linares » Fri Sep 04, 2009 4:17 pm

Otto,

I have modified the original FWH\samples\re.prg to make its interface more friendly:
Image
I am trying to upload the source code here but it seems as it is does not show
regards, saludos

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

Re: fwh\samples\RE.prg - FiveWin Resources Editor underrated

Postby Antonio Linares » Fri Sep 04, 2009 4:25 pm

Otto,

I have uploaded it to the wiki:
http://wiki.fivetechsoft.com/doku.php?i ... ces_editor
regards, saludos

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

PreviousNext

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 49 guests