TFolderex on mdichild is not painted correctly

TFolderex on mdichild is not painted correctly

Postby Rick Lipkin » Tue Oct 15, 2013 4:06 pm

To All

I have a MdiChild with a Dialog with an embedded TFolderex that when the program starts, the initial folder "ADVTBROW" does not completely paint.

Image


Within ADVTBROW is an embedded xBrowse and two buttons .. As you can see xBrowse is not completely painted and the buttons are not visible. However, if you mouse over the panel .. all the TFolderex "ADVTBROW" dialog paints properly.

Image

I have tried the obvious with ON PAINT and to refresh the Folder ON INIT .. nothing works .. here is the snipit of code ..
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

   DEFINE DIALOG oGRPS RESOURCE "CUSTVIEW" ;
   of oWndChild

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

// folder 1

         REDEFINE xBROWSE oLbxA      ;
         RECORDSET oRsAdvt           ;
         COLUMNS "PUBLICATIONID",    ;
                 "PUBLICATIONNAME",  ;
                 "STARTDATE",        ;
                 "ENDINGDATE",       ;
                 "ACCOUNTEXECUTIVE"  ;
         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

..
..  says and gets

   ACTIVATE DIALOG oGRPS NOWAIT   ;
      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. ))
 


One thing I do notice as the initial screen paints .. I do see all the controls momentarily, then the panel folder seems to go out of focus and the buttons disappear and the xBrowse is not painted correctly.

Surely there is a quick fix .. I would appreciate any advice.

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

Re: TFolderex on mdichild is not painted correctly

Postby Rick Lipkin » Tue Oct 15, 2013 10:11 pm

To All

Looking back at some old code, I noticed I had used oGrps:Refresh() in the Window ON INIT clause .. This seems to be a paint fix .. however, I can not get the cursor to move to oName .. even though I explicitly say oName:SetFocus() ...

Here is my current fix ..
Code: Select all  Expand view


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());
           VALID ( IIF( !lOk, ExitPgm( .T.,oRsCust,oRsAdvt,@lOk,oFontB,oWndChild ) , .F. ))
 


Still working on moving the cursor ..

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

Re: TFolderex on mdichild is not painted correctly

Postby cnavarro » Tue Oct 15, 2013 10:28 pm

Rick
You can put the. RC FolderEx dialogs?
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: 6541
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 12:44 pm

Cristobal

I am not sure I understand what you are asking ??
You can put the. RC FolderEx dialogs?

Code: Select all  Expand view

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


The DIALOGS statement refers to "ADVTBROW".rc and "BILLING".rc which automatically creates the dialogs ( panels ) you see then you select the folder tab.
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
}
 


You reference the folder controls ( buttons, says, gets, listboxes ) with .. of oFld:aDialogs[1] or oFld:aDialogs[2]. All you have to do is add the tFoldereX class control line to your .rc ... obviously you will have to change the screen co-ordinates.
Code: Select all  Expand view

CONTROL "", 173, "TFolderex", 0 | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 231, 128, 371, 155
 


Hope that was what you were asking ?

Thanks
Rick Lipkin
Last edited by Rick Lipkin on Wed Oct 16, 2013 2:14 pm, edited 1 time in total.
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: TFolderex on mdichild is not painted correctly

Postby Rick Lipkin » Wed Oct 16, 2013 1:16 pm

To All

I am still struggling to be able to place my cursor at the oName object field .. It appears that after the oGrps:ReFresh() command, the field tab order stack is deleted and even issuing oName:SetFocus() does not place the cursor at my field .. actually, the cursor is no where to be found ??

Any ideas ?

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

Re: TFolderex on mdichild is not painted correctly

Postby Antonio Linares » Wed Oct 16, 2013 3:45 pm

Rick,

Just for a quick test, please replace "TFolderEx" with "SysTabControl32" in your RC and TFOLDEREX with TFOLDER in your PRG to check if it is a TFolderEx related issue.

Also please remember that the ON INIT clause should return .T. to allow the Windows default focus sequence, or .F. if we plan to set the focus somewhere else.
regards, saludos

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

Re: TFolderex on mdichild is not painted correctly

Postby Antonio Linares » Wed Oct 16, 2013 3:47 pm

Rick,

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
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42094
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 6:15 pm

Antonio

Unfortunately, neither suggestion made any difference ... not a cursor to be found on the form anywhere :( .. I do initially see the cursor in the oName field .. then it disappears, probably when the oGrps:ReFresh() is evaluated.

Here is the .rc if that helps any... Control 130 is cName Get

Rick Lipkin
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: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: TFolderex on mdichild is not painted correctly

Postby Antonio Linares » Wed Oct 16, 2013 6:33 pm

Rick,

Is oName a GET ? Please post here the code where you redefine it, thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42094
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 6:42 pm

Antonio

I decided to include the code from the Define Window clause .. look down about half way for the Get .. control 130.

Rick

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

   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 )
             
   // folder 1

         REDEFINE xBROWSE oLbxA      ;
         RECORDSET oRsAdvt           ;
         COLUMNS "PUBLICATIONID",    ;
                 "PUBLICATIONNAME",  ;
                 "STARTDATE",        ;
                 "ENDINGDATE",       ;
                 "ACCOUNTEXECUTIVE"  ;
         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

         oCol := oLbxA:aCols[ 3 ]
         oCol:bStrData := { |x| x := if(oRsAdvt:eof, ,TtoDate(oRsAdvt:Fields("StartDate"):Value)),;
                                     If( Empty(x), ctod(""),x ) }
         oCol := oLbxA:aCols[ 4 ]
         oCol:bStrData := { |x| x := if(oRsAdvt:eof, ,TtoDate(oRsAdvt:Fields("EndingDate"):Value)),;
                                     If( Empty(x), ctod(""),x ) }



         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

   // here is control 130

   // search
   REDEFINE GET oName var cName ID 130 of oGrps ;
         ON CHANGE ( _Isearch( oName, cName, oCid, cCid, oLbx, oRsCust )) UPDATE
   REDEFINE GET oCid  var cCid ID 131 of oGrps ;
         ON CHANGE ( _Isearch( oName, cName, oCid, cCid, oLbx, oRsCust )) 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             ;
         RECORDSET oRsCust           ;
         COLUMNS "CUSTOMERID",       ;
                 "CUSTOMERNAME",     ;
                 "CUSTOMERPHONE",    ;
                 "CUSTOMERCONTACT"   ;
         COLSIZES 75,150,85,150      ;
         HEADERS "Cust Id",          ;
                 "Customer Name",    ;
                 "Phone",            ;
                 "Contact Person"    ;
         ID 172 of oGrps             ;
         AUTOCOLS LINES CELL

       ADD oCol TO oLbx AT 3 DATA {|x| x := _ChkAdd(oRsCust:Fields("CustomerAddress1"):Value,;
                                                   oRsCust:Fields("CustomerCity"):Value,;
                                                   oRsCust:Fields("CustomerState"):Value,;
                                                   oRsCust:Fields("CustomerZip"):Value)};
                                                   HEADER "Address" size 220
       oLbx:lRecordSelector := .f.

       oLbx:lFooter   := .t.
       oCol           := oLbx:aCols[ 1 ]
       oCol:bFooter   := { || Ltrim( Str( oLbx:KeyNo() ) ) + " / " + LTrim( Str( oLbx:KeyCount() ) ) }
       oLbx:bChange   := { || oCol:RefreshFooter() }

       oLbx:bLDblClick := { |nRow,nCol | _CustEdit( oRsCust,oLbx,oRsAdvt,oLbxA,;
                             @cCustomerId,@cCustomerName,@cCustomerAddress1,@cCustomerAddress2,;
                             @cCustomerCity,@cCustomerState,@cCustomerZip,@cCustomerPhone,@cCustomerFax,;
                             @lUseBillTo,@cBillingName,@cBillingAddress1,@cBillingAddress2,@cBillingCity,;                             @cBillingState,@cBillingZip,@cCustomerContact,@cAccountExecutive,@lNotActive,@cCustomerEmail,;
                             oCustomerId,oCustomerName,oCustomerAddress1,oCustomerAddress2,;
                             oCustomerCity,oCustomerState,oCustomerZip,oCustomerPhone,oCustomerFax,;
                             oUseBillTo,oBillingName,oBillingAddress1,oBillingAddress2,oBillingCity,;
                             oBillingState,oBillingZip,oCustomerContact,oAccountExecutive,oNotActive,oCustomerEmail,;
                             oWndChild,@cName,oName,@cCid,oCid,oBtn1,oBtn2,oBtn3,oBtn4,;
                             @lDoNotBill,@lTroubled,oDoNotBill,oTroubled  ),;
                             xMode := "E",oLbx:SetFocus() }


   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 )) ;
      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  _Isearch( oLname1, cLname1, oCid1, cCid1, oLbx, oRsCust )

cLname1 := Alltrim( oLName1:GetText() )
cCid1   := Alltrim( oCid1:GetText() )

If Empty( cLName1 )
   oRsCust:Filter := ""
   oRsCust:Filter := "[CustomerName] = 'bogus'"
   oLbx:ReFresh()
   Return(.T.)
Endif

*oRsCust:Filter := ""
oRsCust:Filter := "[CustomerName] like '"+cLname1+"%'"

oLbx:ReFresh()

Return(.t.)


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

Re: TFolderex on mdichild is not painted correctly

Postby Antonio Linares » Wed Oct 16, 2013 7:09 pm

Rick,

The ON INIT to be used has to be the one of the dialog:

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

and remove it from the window:

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

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42094
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 7:38 pm

Antonio

Still not working .. I substituted your code exactly, not a cursor to be found on the form anywhere :shock:

Rick Lipkin

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

Re: TFolderex on mdichild is not painted correctly

Postby Antonio Linares » Wed Oct 16, 2013 7:58 pm

Rick,

FWH\samples\testmdi4.prg is working fine here and the cursor shows ok in the GET.

I am going to modify it to include a TFolder in it.
regards, saludos

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

Re: TFolderex on mdichild is not painted correctly

Postby Antonio Linares » Wed Oct 16, 2013 8:07 pm

Rick,

It seems as you haven't included this important code section in your PRG:

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

that makes the dialog get the focus, so the control in it gets the focus
regards, saludos

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

Re: TFolderex on mdichild is not painted correctly

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

Rick
I removed the INIT Move the window and it has worked perfectly
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: 6541
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 78 guests