Clipper colors with Read only ( follow up )

Clipper colors with Read only ( follow up )

Postby Rick Lipkin » Thu Mar 15, 2012 12:27 pm

Antonio

Forgive the follow up on this post as I thought the Clipper colors with READONLY was fixed in 1202.

I went back and reviewed your example demonstrating your fix using code :

Code: Select all  Expand view

#include "FiveWin.ch"

function Main()

   local oDlg, cTest := "Hello world"

   TGet():lDisColors = .F.

   DEFINE DIALOG oDlg

   @ 2, 2 GET cTest COLORS "N/R" READONLY
   
   @ 3, 10 BUTTON "Ok" ACTION oDlg:End()

   ACTIVATE DIALOG oDlg CENTERED

return nil
 


and this works fine in FWH1202 .. unfortunately it does not seem to work with resources .. I added the TGet():lDisColors = .F. in my example using resources with clipper colors and READONLY does not work as expected.

Please review the code and see if there is something I have missed ?

Thanks again
Rick Lipkin

Image

Code: Select all  Expand view

// Main.prg
//
//

#INCLUDE "FIVEWIN.CH"

STATIC oEntryBy,oEntryDate
STATIC cEntryBy,dEntryDate
STATIC oStock,cStock,oReq

//-------------------------------
FUNC Main()

LOCAL SAYING,cTITLE,lOK1,oBUTT1,oBUTT2
LOCAL nYear

SET DELETED on
SET CENTURY on
SET 3DLOOK on

nYEAR := ( year( DATE() )-30 )
SET EPOCH to ( nYEAR )

TGet():lDisColors = .F.   // readonly fix

// global gradient
SetDlgGradient( { { .50, nRGB( 201, 217, 237 ), nRGB( 231, 242, 255 ) } } )


lOK    := .F.

cEntryBy          := "USER    "
dEntryDate        := Date()
cStock            := "12345"

cTITLE := "Parts Request Information      EDIT"


DEFINE DIALOG oREQ RESOURCE "REQVIEW" ;
       TITLE cTITLE

   // non tab stop
   REDEFINE GET oEntryBy   VAR cEntryBy   ID 141 of oREQ COLOR CLR_WHITE, CLR_BLUE READONLY
   REDEFINE Say oEntryDate VAR dEntryDate ID 142 of oREQ COLOR "N/W" READONLY

   // tab stop
   REDEFINE GET oStock VAR cStock         ID 113 of oREQ COLOR "N/R" READONLY



REDEFINE BTNBMP oBUTT1 ID 111 of oREQ   ;     // ok
         PROMPT "&Ok      " LEFT 2007;
         ACTION ( oREQ:END() )

REDEFINE BTNBMP oBUTT2 ID 112 of oREQ   ;    // cancel
         PROMPT "&Cancel   " LEFT 2007;
         ACTION ( oREQ:END() )


ACTIVATE DIALOG oREQ centered

RETURN( Nil )

// end
 


.rc

Code: Select all  Expand view

REQVIEW DIALOG 33, 32, 220, 153
STYLE WS_POPUP | WS_CAPTION
CAPTION "Clipper colors Readonly with Resource"
FONT 6, "MS Sans Serif"
{
 LTEXT "No Tab Stop", -1, 9, 16, 30, 24
 EDITTEXT 141, 45, 14, 57, 12, ES_AUTOHSCROLL | NOT WS_TABSTOP | WS_BORDER
 EDITTEXT 142, 45, 28, 57, 12, ES_AUTOHSCROLL | NOT WS_TABSTOP | WS_BORDER
 LTEXT "Tab Stop", -1, 9, 67, 26, 24
 EDITTEXT 113, 46, 71, 57, 12, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP
 CONTROL "&Ok", 111, "TBtnBmp", 32 | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 123, 110, 41, 25
 CONTROL "&Cancel", 112, "TBtnBmp", 32 | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 169, 110, 41, 25
 LTEXT "Get Readonly w rgb", -1, 110, 15, 79, 9
 LTEXT "Say Readonly Color w/n", -1, 110, 29, 90, 9
 LTEXT "Get Readonly color n/r", -1, 110, 72, 90, 9
}
 
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Clipper colors with Read only ( follow up )

Postby ukoenig » Thu Mar 15, 2012 2:11 pm

Rick,
did You test activating the Checkbox inside the Resource ?

EDITTEXT 113, 46, 71, 57, 12, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP

EDITTEXT 113, 46, 71, 57, 12, ES_READONLY | ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP

Best Regards
Uwe :?:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Clipper colors with Read only ( follow up )

Postby Rick Lipkin » Thu Mar 15, 2012 2:31 pm

Uwe

All the fields in my example are text .. I was just trying to show if adding 'tab stop' to the field would make any difference in the behavior of the Get ?

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 107 guests