Treview Help

Treview Help

Postby Horizon » Mon Aug 04, 2008 2:17 pm

Hi,

I have changed FWH/Samples/TestTre2.prg like below.

When the focus is Page-1, The Test1 function could not be called. But "xBase & OOPS" that is under Page-1 calls the Test1.

How Can I solve my problem.

Thanks,

Code: Select all  Expand view  RUN
// -- testtre2.prg
// WinAPI Trees (SysTreeView32) !!!
// Window with a Tree, a Vertical Splitter & a resizable dialog

#include "FiveWin.ch"
#include "Splitter.ch"

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

function Main()

   local oWnd, oDlg, oBar, oTree, oItem1, oItem2, oImageList, oSplit

   DEFINE WINDOW oWnd FROM 3, 6 TO 20, 70 ;
      TITLE "Welcome to " + FWVERSION COLOR "N/W"


   oTree := TTreeView():New( 2, 0, oWnd )

   oTree:bChanged := {|oTree,oItem| ;
      oWnd:SetText( If( oTree:GetSelected():GetParent() != nil,;
                        oTree:GetSelected():GetParent():cPrompt + " + ", "" ) + ;
                          oTree:GetSelText() ), ;
                                 oItem := oTree:GetSelected(), ;
                              If( oItem # nil .and. ValType( oItem:cargo ) == "B", Eval( oItem:cargo ), nil ) }

   oItem1 := oTree:Add( "Page - 1", 1, {|| Test1( oDlg )})                     
   oItem1:Add( "xBase & OOPS", 1, {|| Test1( oDlg ) } )     

   oItem2 := oTree:Add( "Page - 2", 1, {|| Test2( oDlg )})

   DEFINE DIALOG oDlg OF oWnd ;
      STYLE nOR( WS_CHILD, WS_VISIBLE ) ;

   @ 29, 200 SPLITTER oSplit ;
      VERTICAL _3DLOOK ;
      PREVIOUS CONTROLS oTree ;
      HINDS CONTROLS oDlg ;
      SIZE 4, 200 PIXEL ;
      LEFT MARGIN 20 ;
      RIGHT MARGIN 25 ;
      OF oWnd

   ACTIVATE DIALOG oDlg NOMODAL

   ACTIVATE WINDOW oWnd ;
      ON INIT ( oDlg:Move( 0, oSplit:nRight, oWnd:nWidth, oWnd:nHeight, .f. ), ;
                oWnd:bResized := {|| oSplit:AdjClient(), oDlg:SetSize( oWnd:nWidth - oTree:nWidth - oSplit:nWidth - 8, oSplit:nHeight - 1, .t. ) }, ;
                oDlg:refresh(.t.), oTree:refresh(.t.) )  // required so that objects around splitter paint correctly on init

   oImageList:End()

return nil

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

static function CleanSlate( oDlg )

   while Len( oDlg:aControls ) > 0
      ATail( oDlg:aControls ):end()
   end

return nil

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

static function Test1( oDlg )
   Local oGet1, oGet2
   Local cGet1 := PadR( "Type something!", 50 )
   Local cGet2 := PadR( "Type something else!", 50 )

   CleanSlate( oDlg )

   @ 5,10 Say "Some data:" Of oDlg Pixel
   @ 3,70 Get oGet1 Var cGet1 Of oDlg Pixel ;
      Size 150,22

   @ 30,10 Say "Other data:" Of oDlg Pixel
   @ 28,70 Get oGet2 Var cGet2 Of oDlg Pixel ;
      Size 150,22

Return nil

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

static function Test2( oDlg )
   Local oCbx1, oChk1
   Local cCbx1 := "", lChk1 := .t.

   CleanSlate( oDlg )

   @ 5,10 Say "Choose:" Of oDlg Pixel
   @ 3,70 Combobox oCbx1 Var cCbx1 Of oDlg Pixel ;
      Items { "Uno", "Dos", "Tres", "Mambo!" } ;
      Size 80,18

   @ 28,70 Checkbox oChk1 Var lChk1 Of oDlg Pixel ;
      Prompt "Tick tock tick tock" ;
      Size 150,22

Return nil

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

procedure AppSys  // Xbase++ requirement

return

//----------------------------------------------------------------------------// 9
Regards,

Hakan ONEMLI

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

Postby Antonio Linares » Mon Aug 04, 2008 6:20 pm

Hakan,

Try it this way. Here it is working fine:
Code: Select all  Expand view  RUN
#include "FiveWin.ch"
#include "Splitter.ch"

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

function Main()

   local oWnd, oDlg, oBar, oTree, oItem1, oItem2, oImageList, oSplit

   DEFINE WINDOW oWnd FROM 3, 6 TO 20, 70 ;
      TITLE "Welcome to " + FWVERSION COLOR "N/W"


   oTree := TTreeView():New( 2, 0, oWnd )

   oTree:bChanged := { | oItem | oItem := oTree:GetSelected(), If( ValType( oItem:Cargo ) == "B", Eval( oItem:Cargo ),) }

   oItem1 := oTree:Add( "Page - 1", 1 )                     
   oItem1:Cargo = {|| CleanSlate( oDlg )}
   
   oItem1:Add( "xBase & OOPS", 1 ):Cargo = {|| Test1( oDlg ) }     
   
   oTree:Add( "Page - 2", 1 ):Cargo = {|| Test2( oDlg ) }

   DEFINE DIALOG oDlg OF oWnd ;
      STYLE nOR( WS_CHILD, WS_VISIBLE ) ;

   @ 29, 200 SPLITTER oSplit ;
      VERTICAL _3DLOOK ;
      PREVIOUS CONTROLS oTree ;
      HINDS CONTROLS oDlg ;
      SIZE 4, 200 PIXEL ;
      LEFT MARGIN 20 ;
      RIGHT MARGIN 25 ;
      OF oWnd

   ACTIVATE DIALOG oDlg NOMODAL

   ACTIVATE WINDOW oWnd ;
      ON INIT ( oDlg:Move( 0, oSplit:nRight, oWnd:nWidth, oWnd:nHeight, .f. ), ;
                oWnd:bResized := {|| oSplit:AdjClient(), oDlg:SetSize( oWnd:nWidth - oTree:nWidth - oSplit:nWidth - 8, oSplit:nHeight - 1, .t. ) }, ;
                oDlg:refresh(.t.), oTree:refresh(.t.) )  // required so that objects around splitter paint correctly on init

   oImageList:End()

return nil

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

static function CleanSlate( oDlg )

   while Len( oDlg:aControls ) > 0
      ATail( oDlg:aControls ):end()
   end

return nil

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

static function Test1( oDlg )
   Local oGet1, oGet2
   Local cGet1 := PadR( "Type something!", 50 )
   Local cGet2 := PadR( "Type something else!", 50 )

   CleanSlate( oDlg )

   @ 5,10 Say "Some data:" Of oDlg Pixel
   @ 3,70 Get oGet1 Var cGet1 Of oDlg Pixel ;
      Size 150,22

   @ 30,10 Say "Other data:" Of oDlg Pixel
   @ 28,70 Get oGet2 Var cGet2 Of oDlg Pixel ;
      Size 150,22

Return nil

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

static function Test2( oDlg )
   Local oCbx1, oChk1
   Local cCbx1 := "", lChk1 := .t.

   CleanSlate( oDlg )

   @ 5,10 Say "Choose:" Of oDlg Pixel
   @ 3,70 Combobox oCbx1 Var cCbx1 Of oDlg Pixel ;
      Items { "Uno", "Dos", "Tres", "Mambo!" } ;
      Size 80,18

   @ 28,70 Checkbox oChk1 Var lChk1 Of oDlg Pixel ;
      Prompt "Tick tock tick tock" ;
      Size 150,22

Return nil

//----------------------------------------------------------------------------//
regards, saludos

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

Postby Horizon » Tue Aug 05, 2008 10:40 am

Thanks Antonio,

It is working.

I have changed the treview width 200 to 100. treview is ok but the dialogs width did not changed.

Also I have added buttons to dialogs, but I could not find where should i set the new positions of buttons. Because buttons has added dynamicly and Window on resize does not know the variables.

Also I want to put a bevel above of buttons. Is there any class like bevel.

Thanks,

My last source :
Code: Select all  Expand view  RUN
#include "FiveWin.ch"
#include "Splitter.ch"

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

function Main()

   local oWnd, oDlg, oBar, oTree, oItem1, oItem2, oImageList, oSplit

   DEFINE WINDOW oWnd FROM 3, 6 TO 20, 70 ;
      TITLE "Welcome to " + FWVERSION COLOR "N/W"




   oTree := TTreeView():New( 2, 0, oWnd )

   oTree:bChanged := { | oItem | oItem := oTree:GetSelected(), If( ValType( oItem:Cargo ) == "B", Eval( oItem:Cargo ),) }
                   
   oTree:Add( "Page - 1", 1 ):Cargo = {|| Test1( oDlg ) }                     
   oTree:Add( "Page - 2", 1 ):Cargo = {|| Test2( oDlg ) }

   DEFINE DIALOG oDlg OF oWnd ;
      STYLE nOR( WS_CHILD, WS_VISIBLE ) ;

   @ 29, 100 SPLITTER oSplit ;
      VERTICAL _3DLOOK ;
      PREVIOUS CONTROLS oTree ;
      HINDS CONTROLS oDlg ;
      SIZE 4, 100 PIXEL ;
      LEFT MARGIN 20 ;
      RIGHT MARGIN 25 ;
      OF oWnd

   ACTIVATE DIALOG oDlg NOMODAL

   ACTIVATE WINDOW oWnd ;
      ON INIT Wnd_Init(oWnd, oDlg, oSplit, oTree)
   oImageList:End()

return nil

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

static function Wnd_Init(oWnd, oDlg, oSplit, oTree)
   oDlg:Move( 0, oSplit:nRight, oWnd:nWidth, oWnd:nHeight, .f. )
   oWnd:bResized := {|| Wnd_Resize(oWnd, oDlg, oSplit, oTree) }
   oDlg:refresh(.t.)
   oTree:refresh(.t.) // required so that objects around splitter paint correctly on init
return .t.

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

static function Wnd_Resize(oWnd, oDlg, oSplit, oTree)
   oSplit:AdjClient()
   oDlg:SetSize( oWnd:nWidth - oTree:nWidth - oSplit:nWidth - 8, oSplit:nHeight - 1,.t.)
return .t.
   

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

static function CleanSlate( oDlg )

   while Len( oDlg:aControls ) > 0
      ATail( oDlg:aControls ):end()
   end

return nil

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

static function Test1( oDlg )
   Local oGet1, oGet2, oBtnOK, oBtnCancel
   Local cGet1 := PadR( "Type something!", 50 )
   Local cGet2 := PadR( "Type something else!", 50 )

   CleanSlate( oDlg )

   @ 5,10 Say "Some data:" Of oDlg Pixel
   @ 3,70 Get oGet1 Var cGet1 Of oDlg Pixel ;
      Size 150,22

   @ 30,10 Say "Other data:" Of oDlg Pixel
   @ 28,70 Get oGet2 Var cGet2 Of oDlg Pixel ;
      Size 150,22
     
   @ 100, 10 BUTTON oBtnOK PROMPT "OK" Of oDlg Pixel Size 100,25
   @ 100,120 BUTTON oBtnCancel PROMPT "Cancel" Of oDlg Pixel Size 100,25
 
Return nil

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

static function Test2( oDlg )
   Local oCbx1, oChk1
   Local cCbx1 := "", lChk1 := .t.

   CleanSlate( oDlg )

   @ 5,10 Say "Choose:" Of oDlg Pixel
   @ 3,70 Combobox oCbx1 Var cCbx1 Of oDlg Pixel ;
      Items { "Uno", "Dos", "Tres", "Mambo!" } ;
      Size 80,18

   @ 28,70 Checkbox oChk1 Var lChk1 Of oDlg Pixel ;
      Prompt "Tick tock tick tock" ;
      Size 150,22
     
   @ 100, 10 BUTTON oBtnOK PROMPT "OK" Of oDlg Pixel Size 100,25
   @ 100,120 BUTTON oBtnCancel PROMPT "Cancel" Of oDlg Pixel Size 100,25

Return nil

//----------------------------------------------------------------------------//
Regards,

Hakan ONEMLI

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

Postby Horizon » Tue Aug 05, 2008 1:58 pm

Hi,

I have solved the my first problem. I have added oTree:nWidth := 100.

Code: Select all  Expand view  RUN
   oTree := TTreeView():New( 2, 0, oWnd )
-->oTree:nWidth := 100
   oTree:bChanged := { | oItem | oItem := oTree:GetSelected(), If( ValType( oItem:Cargo ) == "B", Eval( oItem:Cargo ),) }
                   
Regards,

Hakan ONEMLI

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

Postby Horizon » Wed Aug 06, 2008 11:42 am

Hi,

I think I have partly solved the my second problem. I can align all the button in dialog box using ClassName()="TBUTTON". Can I select the my obtnOK and obtnCancel variables.

Also I want to put a line above buttons. any suggestions.

Thanks,

Code: Select all  Expand view  RUN
#include "FiveWin.ch"
#include "Splitter.ch"

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

function Main()

   local oWnd, oDlg, oBar, oTree, oItem1, oItem2, oImageList, oSplit

   DEFINE WINDOW oWnd FROM 3, 6 TO 20, 70 ;
      TITLE "Welcome to " + FWVERSION COLOR "N/W"




   oTree := TTreeView():New( 2, 0, oWnd )
    oTree:nWidth := 100
   oTree:bChanged := { | oItem | oItem := oTree:GetSelected(), If( ValType( oItem:Cargo ) == "B", Eval( oItem:Cargo ),) }
                   
   oTree:Add( "Page - 1", 1 ):Cargo = {|| Test1( oDlg ) }                     
   oTree:Add( "Page - 2", 1 ):Cargo = {|| Test2( oDlg ) }

   DEFINE DIALOG oDlg OF oWnd ;
      STYLE nOR( WS_CHILD, WS_VISIBLE ) ;

   @ 29, 100 SPLITTER oSplit ;
      VERTICAL _3DLOOK ;
      PREVIOUS CONTROLS oTree ;
      HINDS CONTROLS oDlg ;
      SIZE 4, 100 PIXEL ;
      LEFT MARGIN 20 ;
      RIGHT MARGIN 25 ;
      OF oWnd

   ACTIVATE DIALOG oDlg NOMODAL

   ACTIVATE WINDOW oWnd ;
      ON INIT Wnd_Init(oWnd, oDlg, oSplit, oTree)
   oImageList:End()

return nil

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

static function Wnd_Init(oWnd, oDlg, oSplit, oTree)
   oDlg:Move( 0, oSplit:nRight, oWnd:nWidth, oWnd:nHeight, .f. )
   oWnd:bResized := {|| Wnd_Resize(oWnd, oDlg, oSplit, oTree) }
   oDlg:refresh(.t.)
   oTree:refresh(.t.) // required so that objects around splitter paint correctly on init
return .t.

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

static function Wnd_Resize(oWnd, oDlg, oSplit, oTree)
   oSplit:AdjClient()
   oDlg:SetSize( oWnd:nWidth - oTree:nWidth - oSplit:nWidth - 8, oSplit:nHeight - 1,.t.)
   Button_Aligment(oDlg)
return .t.
   
//----------------------------------------------------------------------------//

static function Button_Aligment(oDlg)
   local n := 1
   local oControl, oRadMenu
   
   while Len( oDlg:aControls ) > 0
   
         //MsgInfo (Len( oDlg:aControls ))
      
      while n <= Len( oDlg:aControls )
         //MsgInfo(n)
         If Upper( oDlg:aControls[ n ]:ClassName() ) == 'TBUTTON'
            oControl := oDlg:aControls[ n ]
            oControl:nTop := oDlg:nHeight-30
         endif
         n++
         //MsgInfo(n)
      end


      exit
   end
return .t.

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

static function CleanSlate( oDlg )

   while Len( oDlg:aControls ) > 0
      ATail( oDlg:aControls ):end()
   end

return nil

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

static function Test1( oDlg )
   Local oGet1, oGet2, oBtnOK, oBtnCancel
   Local cGet1 := PadR( "Type something!", 50 )
   Local cGet2 := PadR( "Type something else!", 50 )

   CleanSlate( oDlg )

   @ 5,10 Say "Some data:" Of oDlg Pixel
   @ 3,70 Get oGet1 Var cGet1 Of oDlg Pixel ;
      Size 150,22

   @ 30,10 Say "Other data:" Of oDlg Pixel
   @ 28,70 Get oGet2 Var cGet2 Of oDlg Pixel ;
      Size 150,22
     
   @ 100, 10 BUTTON oBtnOK PROMPT "OK" Of oDlg Pixel Size 100,25
   @ 100,120 BUTTON oBtnCancel PROMPT "Cancel" Of oDlg Pixel Size 100,25
   Button_Aligment(oDlg)      
 
Return nil

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

static function Test2( oDlg )
   Local oCbx1, oChk1
   Local cCbx1 := "", lChk1 := .t.

   CleanSlate( oDlg )

   @ 5,10 Say "Choose:" Of oDlg Pixel
   @ 3,70 Combobox oCbx1 Var cCbx1 Of oDlg Pixel ;
      Items { "Uno", "Dos", "Tres", "Mambo!" } ;
      Size 80,18

   @ 28,70 Checkbox oChk1 Var lChk1 Of oDlg Pixel ;
      Prompt "Tick tock tick tock" ;
      Size 150,22
     
   @ 100, 10 BUTTON oBtnOK PROMPT "OK" Of oDlg Pixel Size 100,25
   @ 100,120 BUTTON oBtnCancel PROMPT "Cancel" Of oDlg Pixel Size 100,25
   Button_Aligment(oDlg)      

Return nil

//----------------------------------------------------------------------------//
Regards,

Hakan ONEMLI

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

Postby Antonio Linares » Wed Aug 06, 2008 12:45 pm

Hakan,

Nice to see that you are moving forward :-)

You could use a GROUP of height 1 or 2 pixxels, to get that line painted. Please review @ ..., ... GROUP ... syntax
regards, saludos

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

Postby Horizon » Wed Aug 06, 2008 1:10 pm

Antonio,

I can align all the button in dialog box using ClassName()="TBUTTON". Can I select the my obtnOK and obtnCancel variables.

Regards,
Regards,

Hakan ONEMLI

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

Postby Antonio Linares » Wed Aug 06, 2008 1:13 pm

Hakan,

Yes, it is a good solution. Its the way to do it.
regards, saludos

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

Postby Horizon » Thu Aug 07, 2008 10:11 am

Antonio,

Is it possible to check object ids or objects name rather than the class name?. Because I may use more than i used (Ok and Cancel Buttons) buttons in the same dialog.
Regards,

Hakan ONEMLI

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

Postby Antonio Linares » Thu Aug 07, 2008 10:17 am

Hakan,

You can check oControl:nId
regards, saludos

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

Postby Horizon » Thu Aug 07, 2008 2:35 pm

Antonio,

I used the GROUP command to make BEVEL. But I could not set the one line. It always prints two line. Top and Bottom is the same.

Is there anyting to solve this.

Thanks,

My last code is
Code: Select all  Expand view  RUN
#include "FiveWin.ch"
#include "Splitter.ch"

//----------------------------------------------------------------------------//
STATIC aResize := {}
function Main()

   local oWnd, oDlg, oBar, oTree, oItem1, oItem2, oImageList, oSplit

   DEFINE WINDOW oWnd FROM 3, 6 TO 20, 70 ;
      TITLE "Welcome to " + FWVERSION COLOR "N/W"




   oTree := TTreeView():New( 2, 0, oWnd )
    oTree:nWidth := 100
   oTree:bChanged := { | oItem | oItem := oTree:GetSelected(), If( ValType( oItem:Cargo ) == "B", Eval( oItem:Cargo ),) }
                   
   oTree:Add( "Page - 1", 1 ):Cargo = {|| Test1( oDlg ) }                     
   oTree:Add( "Page - 2", 1 ):Cargo = {|| Test2( oDlg ) }

   DEFINE DIALOG oDlg OF oWnd ;
      STYLE nOR( WS_CHILD, WS_VISIBLE ) ;

   @ 29, 100 SPLITTER oSplit ;
      VERTICAL _3DLOOK ;
      PREVIOUS CONTROLS oTree ;
      HINDS CONTROLS oDlg ;
      SIZE 4, 100 PIXEL ;
      LEFT MARGIN 20 ;
      RIGHT MARGIN 25 ;
      OF oWnd

   ACTIVATE DIALOG oDlg NOMODAL

   ACTIVATE WINDOW oWnd ;
      ON INIT Wnd_Init(oWnd, oDlg, oSplit, oTree)
   oImageList:End()

return nil

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

static function Wnd_Init(oWnd, oDlg, oSplit, oTree)
   oDlg:Move( 0, oSplit:nRight, oWnd:nWidth, oWnd:nHeight, .f. )
   //oDlg:bResized := {|| Dlg_Resize(oDlg) }
   oWnd:bResized := {|| Wnd_Resize(oWnd, oDlg, oSplit, oTree) }
   oDlg:refresh(.t.)
   oTree:refresh(.t.) // required so that objects around splitter paint correctly on init
return .t.

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

static function Wnd_Resize(oWnd, oDlg, oSplit, oTree)
   oSplit:AdjClient()
   oDlg:SetSize( oWnd:nWidth - oTree:nWidth - oSplit:nWidth - 8, oSplit:nHeight - 1,.t.)
   Button_Aligment(oDlg)
return .t.
   
//----------------------------------------------------------------------------//

static function Button_Aligment(oDlg)
   local n := 1
   local oControl, oRadMenu
   local i, lbul:=.f.
   
   if Len( oDlg:aControls ) > 0 .and. Len(Aresize) > 0
   
         //MsgInfo (Len( oDlg:aControls ))
      
      while n <= Len( oDlg:aControls )
         oControl := oDlg:aControls[ n ]
//         MsgInfo(oDlg:aControls[ n ]:nID)
//         MsgInfo(oDlg:aControls[ n ]:cVarName)
//         If Upper( oDlg:aControls[ n ]:ClassName() ) == 'TBUTTON'
         for i:=1 to len(aResize)
            if aResize[i]=oControl:nID
               lbul=.t.
               exit
            endif
         next i
         if lbul
            If Upper( oControl:ClassName() ) == 'TBUTTON'
               oControl:nTop := oDlg:nHeight-30
            elseIf Upper( oControl:ClassName() ) == 'TGROUP'
               oControl:nTop := oDlg:nHeight-40
               oControl:nBottom := oDlg:nHeight-40
               oControl:nWidth := oDlg:nWidth
           endif
           oControl:refresh(.t.)
         endif
         n++
         //MsgInfo(n)
      end
      //MsgInfo("Bitti")      

   end
return .t.

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

static function CleanSlate( oDlg )

   while Len( oDlg:aControls ) > 0
      ATail( oDlg:aControls ):end()
   end
   if len(aResize) > 0
      aResize := {}
   endif

return nil

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

static function Test1( oDlg )
   Local oGet1, oGet2, oBtnOK, oBtnCancel, oGrp
   Local cGet1 := PadR( "Type something!", 50 )
   Local cGet2 := PadR( "Type something else!", 50 )

   CleanSlate( oDlg )
   @ 5,10 Say "Some data:" Of oDlg Pixel
   @ 3,70 Get oGet1 Var cGet1 Of oDlg Pixel ;
      Size 150,22

   @ 30,10 Say "Other data:" Of oDlg Pixel
   @ 28,70 Get oGet2 Var cGet2 Of oDlg Pixel ;
      Size 150,22
  @ 0, 0 GROUP oGrp TO 0,0 PROMPT "" Pixel
  oGrp:nClrText := CLR_BLACK
  @ 100, 10 BUTTON oBtnOK PROMPT "OK" Of oDlg Pixel Size 100,25
   @ 100,120 BUTTON oBtnCancel PROMPT "Cancel" Of oDlg Pixel Size 100,25
   add_AResize(oBtnCancel:nId)
   add_AResize(oBtnOK:nId)
   add_AResize(oGrp:nId)
   Button_Aligment(oDlg)      
 
Return nil

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

static function Test2( oDlg )
   Local oCbx1, oChk1
   Local cCbx1 := "", lChk1 := .t.

   CleanSlate( oDlg )

   @ 5,10 Say "Choose:" Of oDlg Pixel
   @ 3,70 Combobox oCbx1 Var cCbx1 Of oDlg Pixel ;
      Items { "Uno", "Dos", "Tres", "Mambo!" } ;
      Size 80,18

   @ 28,70 Checkbox oChk1 Var lChk1 Of oDlg Pixel ;
      Prompt "Tick tock tick tock" ;
      Size 150,22
     
  @ 0, 0 GROUP oGrp TO 0,0 PROMPT "" Pixel
  oGrp:nClrText := CLR_BLACK
   @ 100, 10 BUTTON oBtnOK PROMPT "OK" Of oDlg Pixel Size 100,25
   @ 100,120 BUTTON oBtnCancel PROMPT "Cancel" Of oDlg Pixel Size 100,25
   add_AResize(oBtnCancel:nId)
   add_AResize(oBtnOK:nId)
   add_AResize(oGrp:nId)
   Button_Aligment(oDlg)      

Return nil

//----------------------------------------------------------------------------//
procedure add_aresize(xp1)
   local i, lbul:=.f.
   for i:=1 to len(aResize)
      if aResize[i]=xp1
         lbul=.t.
         exit
      endif
   next i
   if !lbul
      aadd(aResize, xp1)
   endif
return
Regards,

Hakan ONEMLI

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

Postby Horizon » Sat Aug 09, 2008 11:28 am

Anyone?
Regards,

Hakan ONEMLI

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

Postby Antonio Linares » Sat Aug 09, 2008 12:15 pm

Hakan,

Try to use a SAY (label) with "_____" as its text

Also check the labels styles, as far as I remember they can be used as lines and boxes too
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
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 44 guests