TFolderex on mdichild is not painted correctly

Re: TFolderex on mdichild is not painted correctly

Postby cnavarro » Wed Oct 16, 2013 8:18 pm

Image
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6500
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: TFolderex on mdichild is not painted correctly

Postby Rick Lipkin » Wed Oct 16, 2013 8:19 pm

Antonio

I have added your suggestion .. still no cursor anywhere in sight :cry:

Rick Lipkin
Code: Select all  Expand view

DEFINE ICON oICO RESOURCE "CUSTOMER"

DEFINE WINDOW oWndChild              ;
       MDICHILD                      ;
       FROM 0,1 to 37,117            ;
       NOMINIMIZE                    ;
       ICON oIco                     ;
       NOZOOM                        ;
       OF oWind                      ;
       TITLE cTITLE

   oWndChild:bGotFocus = { || oGrps:SetFocus() }

   DEFINE DIALOG oGRPS RESOURCE "CUSTVIEW" ;
   of oWndChild

 *  REDEFINE FOLDER oFld ID 173 of oGrps ;
 *               PROMPT "Advertising Information", "Billing-Invoicing Information";
 *               DIALOGS "ADVTBROW", "BILLING" //;
            *    ON CHANGE( nFolder := nOption )


   REDEFINE FOLDEREX oFld ID 173 of oGrps ;
                PROMPT "Advertising Information", "Billing-Invoicing Information";
                DIALOGS "ADVTBROW", "BILLING" ;
                ON CHANGE( nFolder := nOption )
 
User avatar
Rick Lipkin
 
Posts: 2618
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: TFolderex on mdichild is not painted correctly

Postby cnavarro » Wed Oct 16, 2013 8:30 pm

Code: Select all  Expand view

#include "Fivewin.ch"
#include "Xbrowse.ch"


Static oWind


Function Main()

   DEFINE WINDOW oWind MDI

   ACTIVATE WINDOW oWind ON INIT ( HazDlgs() ) MAxiMizED

Return nil

Function HazDlgs()
Local oWndChild
Local cTitle     := "Titulo"
Local oGrps
Local oFld
Local nFolder
Local nOption
Local oLbxA
Local oBtn3
Local oBtn4
Local oBtn5
Local oBtn6

//DEFINE ICON oICO RESOURCE "CUSTOMER"

DEFINE WINDOW oWndChild              ;
       MDICHILD                      ;
       FROM 0,1 to 37,117            ;
       NOMINIMIZE                    ; //      ICON oIco                     ;
       NOZOOM                        ;
       OF oWind                      ;
       TITLE cTITLE

   DEFINE DIALOG oGrps RESOURCE "CUSTVIEW" ;
   of oWndChild

oFld := HazBoton( oGrps)
// end folder1

//..
//..  says and gets

   ACTIVATE DIALOG oGrps NOWAIT ;
      ON INIT ( oFld:Refresh(), .T. ) ;
      VALID(!GETKEYSTATE( 27 ))

ACTIVATE WINDOW oWndChild ;
   ON PAINT ( oFld:ReFresh() )
   
   //; //,oLbxA:ReFresh(),SysReFresh() ) ;
   //ON INIT ( oGrps:Move( 0,0, oWndchild:nWidth, oWndchild:nHeight, .T. ) ) // ,  ;
   //   oFld:ReFresh(),oLbxA:ReFresh(),SysReFresh() ,oName:SetFocus());
   // VALID ( IIF( !lOk, ExitPgm( .T.,oRsCust,@lOk,oFontB,oWndChild ) , .F. ))
 

Return nil

Function HazBoton( oGrps )
Local oBtn3
Local oBtn4
Local oBtn5
Local oBtn6
Local oLbxA
Local oFld

   REDEFINE FOLDEREX oFld ID 173 of oGrps ;
                PROMPT "Advertising Information", "Billing-Invoicing Information";
                DIALOGS "ADVTBROW", "BILLING" // ;
                //ON CHANGE( nFolder := nOption )

         REDEFINE xBROWSE oLbxA      ;
         COLSIZES 50,120,80,80,150   ;
         HEADERS "PubId",            ;
                 "Publication",      ;
                 "StartDate",        ;
                 "EndDate",          ;
                 "Acct Executive"    ;
         ID 272 of oFld:aDialogs[1]  ;
         AUTOCOLS LINES CELL

         oLbxA:lRecordSelector := .f.
         oLbxA:lHScroll := .f. // turn off horiz scroll bar


         REDEFINE BTNBMP oBTN5 ID 213 of oFld:aDialogs[1]  ;     // add
         PROMPT "Add" LEFT 2007 ;
         ACTION ( nil )

         REDEFINE BTNBMP oBTN6 ID 214 of oFld:aDialogs[1]  ;     // edit
         PROMPT "Edit" LEFT 2007 ;
         ACTION ( nil )

         REDEFINE BTNBMP oBTN3 ID 313 of oFld:aDialogs[2]  ;     // add
         PROMPT "Add" LEFT 2007 ;
         ACTION ( nil )

         REDEFINE BTNBMP oBTN4 ID 314 of oFld:aDialogs[2]  ;     // edit
         PROMPT "Edit" LEFT 2007 ;
         ACTION ( nil )

Return oFld
 
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6500
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: TFolderex on mdichild is not painted correctly

Postby cnavarro » Wed Oct 16, 2013 8:39 pm

Thus also works OK

Code: Select all  Expand view

.../...
   ACTIVATE DIALOG oGrps NOWAIT ;
      ON INIT ( oGrps:Move( 0,0, oWndchild:nWidth, oWndchild:nHeight, .T. ) ,  ;
                oFld:Refresh(), .T. ) ;
      VALID(!GETKEYSTATE( 27 ))


 
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6500
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: TFolderex on mdichild is not painted correctly

Postby Rick Lipkin » Wed Oct 16, 2013 9:28 pm

Cristobal

Thank you for your help and code contribution .. the problem Antonio and I are ( now ) having is to make the cursor move to the oName field.

I have included the code ( rather lengthy ), compile and notice that the oName:SetFocus() does not move the cursor to the oName ( control 130 ) .. it just disappears :shock: .

See if you get the same results.

Thanks
Rick Lipkin
Code: Select all  Expand view

// main.prg

#include "Fivewin.ch"
#Include "xBrowse.Ch"

Function Main()

   Local oWind

   DEFINE WINDOW oWind MDI

   ACTIVATE WINDOW oWind ON INIT ( _CustView("A",oWind) ) MAxiMizED

   Return nil

//-------------------------------
Static FUNC _CustView( cMODE,oWind )

LOCAL SAYING, oWndChild, oGrps, cSQL, oERR, oIco
LOCAL cTITLE, oBtn1,oBTN2,oBtn3,oBtn4
Local oBtn5,oBtn6

Local lOk
Local oFontB

Local cCustomerId
Local cCustomerName,cCustomerAddress1,cCustomerAddress2,cCustomerCity,cCustomerState
Local cCustomerZip,cCustomerPhone,cCustomerFax
Local lUseBillTo
Local cBillingName,cBillingAddress1,cBillingAddress2,cBillingCity,cBillingState
Local cBillingZip
Local cCustomerContact,cAccountExecutive,lNotActive,cCustomerEmail

Local oCustomerId
Local oCustomerName,oCustomerAddress1,oCustomerAddress2,oCustomerCity,oCustomerState
Local oCustomerZip,oCustomerPhone,oCustomerFax
Local oUseBillTo
Local oBillingName,oBillingAddress1,oBillingAddress2,oBillingCity,oBillingState
Local oBillingZip
Local oCustomerContact,oAccountExecutive,oNotActive,oCustomerEmail

Local lDoNotBill,lTroubled,oDoNotBill,oTroubled,cComment,oComment
Local cSay23,oSay23,cSay24,oSay24


Local oSay1,oSay2,oSay3,oSay4,oSay5,oSay6,oSay7,oSay8,oSay9,oSay10
Local oSay11,oSay12,oSay13,oSay14,oSay15,oSay16,oSay17
Local oSay25,oSay26,oSay27
Local oGrp1,oGrp2,oGrp3

Local cSay21,cSay22,oSay21,oSay22
Local oLbx,cName,cCid,oName,oCid
Local oCol
Local oFld,nFolder,oLbxA

lOk := .F.    // trap valid

LightGreyGrad()
*DarkGreyGrad()

oFontB := TFont():New("Ms Sans Serif",,-6,.F.,.T. ,,,,.F. )
cMode  := "A"

cCustomerId        := "NEW CUSTOMER"
cCustomerName      := space(50)
cCustomerAddress1  := space(35)
cCustomerAddress2  := space(35)
cCustomerCity      := space(15)
cCustomerState     := space(2)
cCustomerZip       := space(10)
cCustomerPhone     := space(15)
cCustomerFax       := space(15)

lUseBillTo         := .f.
cSay21             := "No"

cBillingName       := space(50)
cBillingAddress1   := space(35)
cBillingAddress2   := space(35)
cBillingCity       := space(15)
cBillingState      := space(2)
cBillingZip        := space(10)
cCustomerContact   := space(35)
cAccountExecutive  := space(35)

lDoNotBill         := .f.
cSay23             := "Bill Ok"

lTroubled          := .f.
cSay24             := "No"

lNotActive         := .f.
cSay22             := "Active"

cComment           := ""

// search vars
cName              := space(50)
cCid               := space(15)

cTITLE := "Clients-Billing"

DO CASE
CASE cMODE = "E"
     cTITLE := "Clients-Billing  EDIT   "
CASE cMODE = "A"
     cTITLE := "Clients-Billing   ADD   "
CASE cMODE = "V"
     cTITLE := "Clients-Billing  VIEW   "
ENDCASE

DEFINE WINDOW oWndChild              ;
       MDICHILD                      ;
       FROM 0,1 to 37,117            ;
       NOMINIMIZE                    ;
       ICON oIco                     ;
       NOZOOM                        ;
       OF oWind                      ;
       TITLE cTITLE

   oWndChild:bGotFocus = { || oGrps:SetFocus() }

   DEFINE DIALOG oGRPS RESOURCE "CUSTVIEW" ;
   of oWndChild

 *  REDEFINE FOLDER oFld ID 173 of oGrps ;
 *               PROMPT "Advertising Information", "Billing-Invoicing Information";
 *               DIALOGS "ADVTBROW", "BILLING" //;
            *    ON CHANGE( nFolder := nOption )


   REDEFINE FOLDEREX oFld ID 173 of oGrps ;
                PROMPT "Advertising Information", "Billing-Invoicing Information";
                DIALOGS "ADVTBROW", "BILLING" ;
                ON CHANGE( nFolder := nOption )
              *  ON CHANGE( nFolder := nOption, ;
              *            If( nFolder = 1, oButt7:Show(), oButt7:Hide() ),;
              *            If( nFolder = 2, xMode := "A", ),;
              *            If( nFolder = 3, xMode := "A", ))

   // folder 1

         REDEFINE xBROWSE oLbxA      ;
         COLSIZES 50,120,80,80,150   ;
         HEADERS "PubId",            ;
                 "Publication",      ;
                 "StartDate",        ;
                 "EndDate",          ;
                 "Acct Executive"    ;
         ID 272 of oFld:aDialogs[1]  ;
         AUTOCOLS LINES CELL

         oLbxA:lRecordSelector := .f.
         oLbxA:lHScroll := .f. // turn off horiz scroll bar

         REDEFINE BTNBMP oBTN5 ID 213 of oFld:aDialogs[1]  ;     // add
         PROMPT "Add" LEFT 2007;
         ACTION ( nil )

         REDEFINE BTNBMP oBTN6 ID 214 of oFld:aDialogs[1]  ;     // edit
         PROMPT "Edit" LEFT 2007;
         ACTION ( nil )


   // end folder1


   REDEFINE GROUP oGrp1 ID 200 OF oGrps
        oGrp1:SetFont( oFontB )
        oGrp1:nClrText := nRgb( 7,7,224 ) // blue
   REDEFINE SAY oSay1  PROMPT "Company"        ID 110 OF oGrps UPDATE
                oSay1:SetFont( oFontB )
   REDEFINE SAY oSay2  PROMPT "Customer Id"    ID 111 OF oGrps UPDATE
                oSay2:SetFont( oFontB )

   REDEFINE GROUP oGrp2 ID 201 OF oGrps
        oGrp2:SetFont( oFontB )
        oGrp2:nClrText := nRgb( 7,7,224 ) // blue
   REDEFINE SAY oSay3  PROMPT "Customer Id"    ID 112 OF oGrps UPDATE
                oSay3:SetFont( oFontB )
   REDEFINE SAY oSay4  PROMPT "Company Name"   ID 113 OF oGrps UPDATE
                oSay4:SetFont( oFontB )
   REDEFINE SAY oSay5  PROMPT "Address"        ID 114 OF oGrps UPDATE
                oSay5:SetFont( oFontB )
   REDEFINE SAY oSay6  PROMPT "City\St\Zip"    ID 115 OF oGrps UPDATE
                oSay6:SetFont( oFontB )

   REDEFINE GROUP oGrp3 ID 202 OF oGrps
        oGrp3:SetFont( oFontB )
        oGrp3:nClrText := nRgb( 7,7,224 ) // blue
   REDEFINE SAY oSay7  PROMPT "Bill to This Address" ID 116 OF oGrps UPDATE
                oSay7:SetFont( oFontB )
   REDEFINE SAY oSay8  PROMPT "Company Name"   ID 117 OF oGrps UPDATE
                oSay8:SetFont( oFontB )
   REDEFINE SAY oSay9  PROMPT "Address"        ID 118 OF oGrps UPDATE
                oSay9:SetFont( oFontB )
   REDEFINE SAY oSay10 PROMPT "City\St\Zip"    ID 119 OF oGrps UPDATE
                oSay10:SetFont( oFontB )
   REDEFINE SAY oSay11 PROMPT "Phone\Fax"      ID 120 OF oGrps UPDATE
                oSay11:SetFont( oFontB )
   REDEFINE SAY oSay12 PROMPT "Contact"        ID 121 of oGrps UPDATE
                oSay12:SetFont( oFontB )
   REDEFINE SAY oSay13 PROMPT "E-Mail"         ID 122 OF oGrps UPDATE
                oSay13:SetFont( oFontB )
   REDEFINE SAY oSay14 PROMPT "Account Executive"  ID 123 of oGrps UPDATE
                oSay14:SetFont( oFontB )
   REDEFINE SAY oSay25 PROMPT "Do Not Bill"    ID 127 of oGrps UPDATE
                oSay25:SetFont( oFontB )
   REDEFINE SAY oSay26 PROMPT "Red Flag"       ID 128 of oGrps UPDATE
                oSay26:SetFont( oFontB )
   REDEFINE SAY oSay15 PROMPT "Not Active"     ID 124 of oGrps UPDATE
                oSay15:SetFont( oFontB )
   REDEFINE SAY oSay27 PROMPT "Comments"       ID 158 of oGrps UPDATE
                oSay27:SetFont( oFontB )

   REDEFINE SAY oSay16 ID 125 OF oGrps UPDATE  // customer names
                oSay16:SetFont( oFontB )
                oSay16:SetColor(nRgb(7,7,224)) // blue
   REDEFINE SAY oSay17 ID 126 OF oGrps UPDATE  // double click ...
                oSay17:SetFont( oFontB )
                oSay17:SetColor(nRgb(7,7,224)) // blue

   REDEFINE SAY oSay21 var cSay21 ID 140 of oGrps UPDATE  // bill to this address
                oSay21:SetFont( oFontB )
   If cSay21 = "Yes"
   Else
      oSay21:SetColor( CLR_HRED )
   Endif

   REDEFINE SAY oSay22 var cSay22 ID 153 of oGrps UPDATE  // not active
   oSay22:SetFont( oFontB )
   If cSay22 = "Active"
   Else
      oSay22:SetColor( CLR_HRED )
   Endif

   REDEFINE SAY oSay23 var cSay23 ID 155 of oGrps UPDATE  // do not bill
   oSay23:SetFont( oFontB )
   If cSay23 = "Bill Ok"
   Else
      oSay23:SetColor( CLR_HRED )
   Endif

   REDEFINE SAY oSay24 var cSay24 ID 157 of oGrps UPDATE  // troubled
   oSay24:SetFont( oFontB )
   If cSay24 = "No"
   Else
      oSay24:SetColor( CLR_HRED )
   Endif

   // search
   REDEFINE GET oName var cName ID 130 of oGrps UPDATE

   REDEFINE GET oCid  var cCid ID 131 of oGrps UPDATE

   // fields
   REDEFINE GET oCustomerId       var cCustomerId       ID 132 of oGrps COLOR CLR_BLACK, 16773845 READONLY
   REDEFINE GET oCustomerName     var cCustomerName     ID 133 of oGrps UPDATE
   REDEFINE GET oCustomerAddress1 var cCustomerAddress1 ID 134 of oGrps UPDATE
   REDEFINE GET oCustomerAddress2 var cCustomerAddress2 ID 135 of oGrps UPDATE
   REDEFINE GET oCustomerCity     var cCustomerCity     ID 136 of oGrps UPDATE
   REDEFINE GET oCustomerState    var cCustomerState    ID 137 of oGrps UPDATE
   REDEFINE GET oCustomerZip      var cCustomerZip      ID 138 of oGrps UPDATE

   // billto
   REDEFINE CHECKBOX oUseBillTo   var lUseBillTo        ID 139 of oGrps ;
            when cMode <> "V" ;
            ON CHANGE _ChkBillTo( lUseBillTo,@cSay21,oSay21 )

   REDEFINE GET oBillingName      var cBillingName      ID 141 of oGrps ;
       When lUseBillTo = .t. UPDATE
   REDEFINE GET oBillingAddress1  var cBillingAddress1  ID 142 of oGrps ;
       When lUseBillTo = .t. UPDATE
   REDEFINE GET oBillingAddress2  var cBillingAddress2  ID 143 of oGrps ;
       When lUseBillTo = .t. UPDATE
   REDEFINE GET oBillingCity      var cBillingCity      ID 144 of oGrps ;
       When lUseBillTo = .t. UPDATE
   REDEFINE GET oBillingState     var cBillingState     ID 145 of oGrps ;
       When lUseBillTo = .t. UPDATE
   REDEFINE GET oBillingZip       var cBillingZip       ID 146 of oGrps ;
       When lUseBillTo = .t. UPDATE


   REDEFINE GET oCustomerPhone    var cCustomerPhone    ID 147 of oGrps ;
            valid _PFormat( @cCustomerPhone, oCustomerPhone ) UPDATE
   REDEFINE GET oCustomerFax      var cCustomerFax      ID 148 of oGrps ;
            valid _PFormat( @cCustomerFax, oCustomerFax ) UPDATE
   REDEFINE GET oCustomerContact  var cCustomerContact  ID 149 of oGrps UPDATE
   REDEFINE GET oCustomerEmail    var cCustomerEmail    ID 150 of oGrps UPDATE
   REDEFINE GET oAccountExecutive var cAccountExecutive ID 151 of oGrps UPDATE

   REDEFINE CHECKBOX oDoNotBill   var lDoNotBill        ID 154 of oGrps ;
            when cMode <> "V" ;
            ON CHANGE _ChkBill( lDoNotBill,@cSay23,oSay23 )

   REDEFINE CHECKBOX oTroubled    var lTroubled         ID 156 of oGrps ;
            when cMode <> "V" ;
            ON CHANGE _ChkTrouble( lTroubled,@cSay24,oSay24 )

   REDEFINE CHECKBOX oNotActive   var lNotActive        ID 152 of oGrps ;
            when cMode <> "V" ;
            ON CHANGE _ChkActive( lNotActive,@cSay22,oSay22 )

   REDEFINE xBROWSE oLBX             ;
         COLSIZES 75,150,85,150      ;
         HEADERS "Cust Id",          ;
                 "Customer Name",    ;
                 "Phone",            ;
                 "Contact Person"    ;
         ID 172 of oGrps             ;
         AUTOCOLS LINES CELL

       oLbx:lRecordSelector := .f.


   REDEFINE BTNBMP oBTN1 ID 180 of oGRPS  ;     // save new
         RESOURCE "OK", "DOK", "DOK" ;
         PROMPT "    Save New  " LEFT 2007;
         ACTION ( nil )

   REDEFINE BTNBMP oBTN2 ID 181 of oGRPS   ;    // add new
         RESOURCE "PLUS16", "DPLUS16", "DPLUS16" ;
         PROMPT "      Add New  " LEFT 2007;
         ACTION ( lOK := .F., oWndChild:END() )

   REDEFINE BTNBMP oBTN3 ID 182 of oGRPS   ;    // close
         RESOURCE "CANCEL", "DCANCEL", "DCANCEL" ;
         PROMPT "      Close   " LEFT 2007;
         ACTION ( lOK := .F., oWndChild:END() )

   REDEFINE BTNBMP oBTN4 ID 183 of oGRPS  ;     // save edit
         RESOURCE "OK", "DOK", "DOK" ;
         PROMPT "   Save Edit  " LEFT 2007;
         ACTION ( nil )

ACTIVATE DIALOG oGRPS NOWAIT ;
         ON INIT (oGrps:Move( 0,0 ), oName:SetFocus(), .F. ) ;
         VALID(!GETKEYSTATE( 27 ))

ACTIVATE WINDOW oWndChild ;
         ON INIT ( ;
         oWndChild:bResized := {|| _ReSizeUm( oGrps,oWndChild,oLbx,oLbxA) }, ;
         oGrps:ReFresh() )


/*
   ACTIVATE DIALOG oGRPS NOWAIT   ;
      ON INIT (oGrps:Move( 0,0 )) ;
      VALID(!GETKEYSTATE( 27 ))

ACTIVATE WINDOW oWndChild ;
ON INIT ( ;
oWndChild:bResized := {|| _ReSizeUm( oGrps,oWndChild,oLbx,oLbxA) }, ;
oGrps:ReFresh(),oName:SetFocus(), .F. ) // as we want the focus at a certain control
*/


/*
   ACTIVATE WINDOW oWndChild ;
   ON INIT (  ;
           oWndChild:bResized := {|| _ReSizeUm( oGrps,oWndChild,oLbx,oLbxA) }, ;
            _Hidum(oBillingName,oBillingAddress1,oBillingAddress2,;
                                          oBillingCity,oBillingState,oBillingZip,;
                                          oBtn1,oBtn2,oBtn3,oBtn4),;
           oGrps:ReFresh(),oName:SetFocus());
           VALID ( IIF( !lOk, ExitPgm( .T.,oRsCust,oRsAdvt,@lOk,oFontB,oWndChild ) , .F. ))
*/


RETURN( lOK )


//------------------
Static Func LightGreyGrad()

SetDlgGradient( { { .50, nRGB( 216, 216, 216 ), nRGB( 255, 255, 255 ) } } )

Return(nil)

//------------------------
Func _PFormat( cPh, oPh )

Local xPhone

If cPh = "  "
   Return(.t.)
Endif

cPh := alltrim( cPh )

// already formatted  "(999)-999-9999"
If len( cPh ) = 10
Else
   Return(.t.)
Endif

xPhone := Transform( cPh, "@R (999)-999-9999")
xPhone := substr(xPhone+space(15),1,15)

cPh := xPhone
oPh:ReFresh()
SysReFresh()

Return(.t.)


//------------------------------
Static Func _ReSizeUm( oGrps,oWndChild,oLbx,oLbxA )


oGrps:SetSize( oWndChild:nWidth, oWndChild:nHeight, .t. ) // frame and dialog link

// dialog controls
oGrps:bResized = { | nSizeType, nWidth, nHeight | ResizeControls( nSizeType, nWidth, nHeight, oGrps ) }

oLbxA:SetFocus()

Return(nil)

//-------------------------
Static Func ResizeControls( nSizeType, nWidth, nHeight, oGrps )


if nSizeType = 0 //SIZE_MAXIMIZED

*   xbrowse( oGrps:aControls )            // 37          247
   oGrps:aControls[ 1  ]:SetSize( nWidth - 372, nHeight - 340 ) //folder

endif

Return(nil)


//-------------------------------
Static Func _ChkBillTo( lUseBillTo,cSay21,oSay21 )

If lUseBillTo = .t.
   cSay21 := "Yes"
   oSay21:SetColor ( CLR_BLACK )
Else
   cSay21 := "No"
   oSay21:SetColor ( CLR_HRED )
Endif
oSay21:ReFresh()

Return(nil)

//----------------------------
Static Func _ChkActive( lNotActive,cSay22,oSay22 )

If lNotActive = .t.
   cSay22 := "Not Active"
   oSay22:SetColor ( CLR_HRED )
Else
   cSay22 := "Active"
   oSay22:SetColor ( CLR_BLACK )
Endif
oSay22:ReFresh()

Return(nil)

//-----------------------
Static Func _ChkBill( lDoNotBill,cSay23,oSay23 )

If lDoNotBill = .t.
   cSay23 := "No Bill"
   oSay23:SetColor ( CLR_HRED )
Else
   cSay23 := "Bill Ok"
   oSay23:SetColor ( CLR_BLACK )
Endif
oSay23:ReFresh()

Return(nil)

//--------------------
Static Func _ChkTrouble( lTroubled,cSay24,oSay24 )

If lTroubled = .t.
   cSay24 := "Yes"
   oSay24:SetColor ( CLR_HRED )
Else
   cSay24 := "No"
   oSay24:SetColor ( CLR_BLACK )
Endif
oSay24:ReFresh()

Return(nil)

//------------------
Static Func _HidUm( oBillingName,oBillingAddress1,oBillingAddress2,;
                                 oBillingCity,oBillingState,oBillingZip,;
                                 oBtn1,oBtn2,oBtn3,oBtn4)

oBillingName:lDisColors    := .f.
oBillingName:nClrTextDis    := CLR_BLACK // Color text disable status
oBillingName:nClrPaneDis   := 14869218 // Color Pane disable status
oBillingName:ReFresh()

oBillingAddress1:lDisColors    := .f.
oBillingAddress1:nClrTextDis   := CLR_BLACK // Color text disable status
oBillingAddress1:nClrPaneDis   := 14869218 // Color Pane disable status
oBillingAddress1:ReFresh()

oBillingAddress2:lDisColors    := .f.
oBillingAddress2:nClrTextDis   := CLR_BLACK // Color text disable status
oBillingAddress2:nClrPaneDis   := 14869218 // Color Pane disable status
oBillingAddress2:ReFresh()

oBillingCity:lDisColors    := .f.
oBillingCity:nClrTextDis   := CLR_BLACK // Color text disable status
oBillingCity:nClrPaneDis   := 14869218 // Color Pane disable status
oBillingCity:ReFresh()

oBillingState:lDisColors    := .f.
oBillingState:nClrTextDis   := CLR_BLACK // Color text disable status
oBillingState:nClrPaneDis   := 14869218 // Color Pane disable status
oBillingState:ReFresh()

oBillingZip:lDisColors    := .f.
oBillingZip:nClrTextDis   := CLR_BLACK // Color text disable status
oBillingZip:nClrPaneDis   := 14869218 // Color Pane disable status
oBillingZip:ReFresh()

oBtn2:Hide()
oBtn4:Hide()


Return(nil)

//----------------------
Static FUNC _CleanUp()

RETURN(.T.)

//-----------------------
Static FUNCTION ExitPgm( lClean,oRsCust,oRsAdvt,lOk,oFontB,oWndChild )

Local Saying

IF lCLEAN = .T.
   lOk := .T.

   LightGreyGrad()

   RELEASE oFontB

ENDIF

RETURN( lOk )
 

advtbrow.rc
Code: Select all  Expand view

ADVTBROW DIALOG 12, 11, 365, 131
STYLE WS_CHILD
FONT 6, "MS Sans Serif"
{
 CONTROL "", 272, "TXBrowse", 0 | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_VSCROLL | WS_TABSTOP, 35, 4, 327, 123
 CONTROL "Add", 213, "TBtnBmp", 32 | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 5, 10, 27, 19
 CONTROL "Edit", 214, "TBtnBmp", 32 | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 5, 31, 27, 19
}
 

billing.rc
Code: Select all  Expand view

BILLING DIALOG 12, 11, 401, 179
STYLE WS_CHILD
FONT 6, "MS Sans Serif"
{
}
 

custview.rc
Code: Select all  Expand view

CUSTVIEW DIALOG 3, 13, 612, 343
STYLE WS_CHILD
FONT 6, "MS Sans Serif"
{
 EDITTEXT 130, 56, 12, 160, 12, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP
 EDITTEXT 131, 56, 25, 98, 12, ES_CENTER | ES_AUTOHSCROLL | NOT WS_TABSTOP | WS_BORDER
 EDITTEXT 132, 56, 59, 98, 12, ES_CENTER | ES_AUTOHSCROLL | NOT WS_TABSTOP | WS_BORDER
 EDITTEXT 133, 56, 72, 160, 12, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP
 EDITTEXT 134, 56, 86, 160, 12, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP
 EDITTEXT 135, 56, 100, 160, 12, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP
 EDITTEXT 136, 56, 114, 71, 12, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP
 EDITTEXT 137, 131, 114, 23, 12, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP
 EDITTEXT 138, 161, 114, 55, 12, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP
 EDITTEXT 141, 56, 163, 160, 12, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP
 EDITTEXT 142, 56, 177, 160, 12, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP
 EDITTEXT 143, 56, 191, 160, 12, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP
 EDITTEXT 144, 56, 205, 71, 12, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP
 EDITTEXT 145, 131, 205, 23, 12, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP
 EDITTEXT 146, 161, 205, 55, 12, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP
 EDITTEXT 147, 56, 228, 71, 12, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP
 EDITTEXT 148, 131, 228, 85, 12, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP
 EDITTEXT 149, 56, 242, 160, 12, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP
 EDITTEXT 150, 56, 256, 160, 12, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP
 EDITTEXT 151, 56, 270, 160, 12, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP
 CHECKBOX "", 152, 56, 326, 8, 8, BS_AUTOCHECKBOX | NOT WS_TABSTOP
 EDITTEXT 153, 70, 325, 48, 12, ES_AUTOHSCROLL | WS_BORDER | WS_GROUP | WS_TABSTOP
 CONTROL "&Close", 182, "TBtnBmp", 32 | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 532, 315, 70, 17
 LTEXT "Company Name", 113, 7, 72, 46, 18, SS_NOPREFIX | WS_GROUP
 CONTROL "Customer Info", 172, "TXBrowse", 0 | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP, 230, 13, 373, 110
 LTEXT "Address", 114, 7, 94, 46, 12, SS_NOPREFIX | WS_GROUP
 LTEXT "City\\St\\Zip", 115, 7, 115, 46, 12, SS_NOPREFIX | WS_GROUP
 LTEXT "Phone\\Fax ", 120, 6, 228, 46, 12, SS_NOPREFIX | WS_GROUP
 LTEXT "Contact ", 121, 6, 242, 46, 12, SS_NOPREFIX | WS_GROUP
 LTEXT "E-Mail", 122, 6, 255, 46, 12, SS_NOPREFIX | WS_GROUP
 GROUPBOX "  Physical Address ", 201, 3, 44, 221, 87, BS_GROUPBOX
 LTEXT "Customer Id", 112, 7, 60, 46, 12, SS_NOPREFIX | WS_GROUP
 CONTROL "&Add New", 181, "TBtnBmp", 32 | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 459, 315, 70, 17
 CONTROL "&Save New", 180, "TBtnBmp", 32 | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 386, 315, 70, 17
 LTEXT "Customer Names", 125, 231, 2, 69, 11, SS_NOPREFIX | WS_GROUP
 LTEXT "( double click the Customer to load detail )", 126, 323, 2, 204, 11, SS_NOPREFIX | WS_GROUP
 CHECKBOX "", 139, 57, 148, 8, 8, BS_AUTOCHECKBOX | NOT WS_TABSTOP
 LTEXT "Bill To This Address", 116, 7, 145, 46, 18, SS_NOPREFIX | WS_GROUP
 EDITTEXT 140, 71, 147, 23, 12, ES_AUTOHSCROLL | WS_BORDER | WS_GROUP | WS_TABSTOP
 LTEXT "Company Name", 117, 7, 163, 46, 18, SS_NOPREFIX | WS_GROUP
 LTEXT "Address", 118, 7, 186, 46, 12, SS_NOPREFIX | WS_GROUP
 LTEXT "City\\St\\Zip", 119, 7, 206, 45, 12, SS_NOPREFIX | WS_GROUP
 GROUPBOX "  Billing Address ", 202, 3, 133, 221, 90, BS_GROUPBOX
 LTEXT "Company", 110, 7, 12, 46, 12, SS_NOPREFIX | WS_GROUP
 GROUPBOX "  Search", 200, 3, 1, 221, 41, BS_GROUPBOX
 LTEXT "Not Active", 124, 6, 325, 46, 12, SS_NOPREFIX | WS_GROUP
 LTEXT "Customer Id", 111, 7, 25, 46, 12, SS_NOPREFIX | WS_GROUP
 LTEXT "Account Executive", 123, 6, 268, 46, 18, SS_NOPREFIX | WS_GROUP
 CONTROL "Save Edit", 183, "TBtnBmp", 32 | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 313, 315, 70, 17
 CONTROL "", 173, "TFolderex", 0 | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 231, 128, 371, 155
 CHECKBOX "", 154, 56, 297, 8, 8, BS_AUTOCHECKBOX | NOT WS_TABSTOP
 EDITTEXT 155, 70, 296, 48, 12, ES_AUTOHSCROLL | WS_BORDER | WS_GROUP | WS_TABSTOP
 LTEXT "Do Not Bill", 127, 6, 296, 46, 12, SS_NOPREFIX | WS_GROUP
 CHECKBOX "", 156, 56, 312, 8, 8, BS_AUTOCHECKBOX | NOT WS_TABSTOP
 EDITTEXT 157, 70, 311, 48, 12, ES_AUTOHSCROLL | WS_BORDER | WS_GROUP | WS_TABSTOP
 LTEXT "Red Flag", 128, 6, 311, 46, 12, SS_NOPREFIX | WS_GROUP
 EDITTEXT 159, 125, 296, 179, 42, ES_MULTILINE | ES_AUTOVSCROLL | WS_BORDER | WS_VSCROLL | WS_TABSTOP
 LTEXT "Comments", 158, 125, 284, 46, 10, SS_NOPREFIX | WS_GROUP
}
 
User avatar
Rick Lipkin
 
Posts: 2618
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: TFolderex on mdichild is not painted correctly

Postby cnavarro » Wed Oct 16, 2013 9:36 pm

Rick
In my code the cursor is positioned in the control 130, defined by the order of the dialogue
I will look at the code that has been
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6500
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: TFolderex on mdichild is not painted correctly

Postby cnavarro » Wed Oct 16, 2013 9:49 pm

Rick
The problem is in this function it assign the focus to the xbrowse
If you cancel this line the program works OK


Code: Select all  Expand view

Static Func _ReSizeUm( oGrps,oWndChild,oLbx,oLbxA )


oGrps:SetSize( oWndChild:nWidth, oWndChild:nHeight, .t. ) // frame and dialog link

// dialog controls
oGrps:bResized = { | nSizeType, nWidth, nHeight | ResizeControls( nSizeType, nWidth, nHeight, oGrps ) }

//oLbxA:SetFocus()

Return(nil)
 
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6500
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: TFolderex on mdichild is not painted correctly

Postby Antonio Linares » Wed Oct 16, 2013 9:49 pm

Rick,

You are giving the focus to oLbxA from here:
Code: Select all  Expand view
Static Func _ReSizeUm( oGrps,oWndChild,oLbx,oLbxA )


oGrps:SetSize( oWndChild:nWidth, oWndChild:nHeight, .t. ) // frame and dialog link

// dialog controls
oGrps:bResized = { | nSizeType, nWidth, nHeight | ResizeControls( nSizeType, nWidth, nHeight, oGrps ) }

// oLbxA:SetFocus()  Here is the problem! :-)

Return(nil)


I tell you how I found it: First I check what control had the focus this way:
Code: Select all  Expand view
ACTIVATE DIALOG oGRPS NOWAIT ;
         ON INIT (oGrps:Move( 0,0 ), oName:SetFocus(), .F. ) ;
         ON CLICK MsgInfo( oWndFromHwnd( GetFocus() ):cVarName ) ;
         VALID(!GETKEYSTATE( 27 ))


So it showed oLbxA, then I look for that var name in your code and found that code that was quitting the focus to oName :-)
regards, saludos

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

Re: TFolderex on mdichild is not painted correctly

Postby Rick Lipkin » Wed Oct 16, 2013 10:08 pm

Antonio and Cristobal

Gentleman, thank you for finding such a DUMB error :oops: ... I just got so wrapped up in the code, I did not look for the setfocus() of the browse ..

Like most programmers .. I like to take bits and pieces of code from different programs and blend them together .. in this case I just missed it in frustration.

I need to go home and find my bottle of Grecian formula grey hair cover-upp'er .. turned a bit more grey today !

Thanks
Rick Lipkin
User avatar
Rick Lipkin
 
Posts: 2618
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: TFolderex on mdichild is not painted correctly

Postby cnavarro » Wed Oct 16, 2013 10:46 pm

Happened to me too many times
"Four eyes see more than two"
Glad to help
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6500
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: TFolderex on mdichild is not painted correctly

Postby Antonio Linares » Fri Oct 18, 2013 6:27 am

We all suffer this from time to time :-)

No problem at all
regards, saludos

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

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 98 guests