Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Readonly CheckBox
Message
From
20/02/2008 11:20:19
Charlie Schreiner
Myers and Stauffer Consulting
Topeka, Kansas, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Readonly CheckBox
Miscellaneous
Thread ID:
01294292
Message ID:
01294292
Views:
55
I searched for issues with a ReadOnly CheckBox, but didn't find this issue. Can I get a confirmation that this is a bug? Seems odd I never noticed it before.
Save this text into chkBoxText.PRG, then DO chkBoxText.PRG
#DEFINE CRLF CHR(13) + CHR(10)
PUBLIC o AS Form
o = NEWOBJECT('frmTest', 'chkboxTest.PRG')
o.Show()

DEFINE CLASS frmTest as Form
   ADD OBJECT chkBox AS MyCheckBox WITH ;
      AutoSize = .T., ;
      Caption = "Read only CheckBox", ;
      ControlSource = "Test.IsHelp", ;
      Left = 30, ;
      ReadOnly = .T., ;
      Top = 30, ;
      Name = "chkBox"
      

   ADD OBJECT cmdRevert AS MyCommand WITH ;
      Left = 30, ;
      ReadOnly = .T., ;
      Top = 80, ;
      Height = 24, ;
      Caption = "Revert", ;
      Name = "cmdRevert"
      
   ADD OBJECT edtShow AS MyEditBox WITH ;
      Left = 190, ;
      ReadOnly = .T., ;
      Top = 30, ;
      Height = 190, ;
      Width = 250, ;
      Name = "edtShow"
      
   Caption = "Why does a ReadOnly checkbox dirty the buffer?"
   Width = 450
   PROCEDURE Load()
      CREATE CURSOR Test (IsHelp L)
      INSERT INTO Test (IsHelp) VALUES (.F.)
      CURSORSETPROP("Buffering", 5,"Test")
   ENDPROC

   PROCEDURE ShowText(Text2Show)      
      This.edtShow.Show(m.Text2Show)
   ENDPROC
ENDDEFINE


DEFINE CLASS MyCheckBox as CheckBox

   PROCEDURE Click()
      ThisForm.ShowText(PROGRAM() + " " + GETFLDSTATE(-1,"Test"))
   ENDPROC

   PROCEDURE MouseUp(nButton, nShift, nXCoord, nYCoord)
      ThisForm.ShowText(PROGRAM() + " " ;
         + GETFLDSTATE(-1,"Test") + " And this dirties the buffer!")
   ENDPROC

   PROCEDURE MouseDown(nButton, nShift, nXCoord, nYCoord)
      ThisForm.ShowText(PROGRAM() + " " + GETFLDSTATE(-1,"Test"))
   ENDPROC
   
ENDDEFINE

DEFINE CLASS MyCommand as CommandButton

   PROCEDURE Click()
      TABLEREVERT()
      ThisForm.ShowText(PROGRAM() + " " + GETFLDSTATE(-1,"Test"))
   ENDPROC
ENDDEFINE

DEFINE CLASS MyEditBox as EditBox

   PROCEDURE Show(Text2Show)
      This.Value = IIF(EMPTY(This.Value), '', This.Value + CRLF) ;
         + m.Text2Show
      This.SelStart = LEN(THIS.Value)
      This.Refresh
   ENDPROC
ENDDEFINE
Charlie
Next
Reply
Map
View

Click here to load this message in the networking platform