• Welcome to PlanetSquires Forums.
 

WinFBE - CheckBox

Started by SeaVipe, November 05, 2018, 12:28:03 PM

Previous topic - Next topic

SeaVipe

Hello,


CheckBox MouseUp and MouseDown appear to have logic in the reverse of Click. This may be by design but I'm not sure why.
Clive Richey

Paul Squires

I am not sure what you mean. Are you checking the value of CheckState during the mouse event or something like that? The value of the checkbox will retain its previous value until the Click notification has fired. That is, say for example, if the CheckBox is UnChecked then during mousedown and mouseup the CheckState will return CheckBoxState.UnChecked (a value of 2). Once you release your mouse then the Click will happen and the value of CheckBoxState.Checked (a value of 1) should be reported.


''
''
Function Form1_Check1_Click( ByRef sender As wfxCheckBox, ByRef e As EventArgs ) As LRESULT
   ? "check click", sender.CheckState, iif(sender.CheckState=1, "Checked", "UnChecked")
   Function = 0
End Function

''
''
Function Form1_Check1_MouseDown( ByRef sender As wfxCheckBox, ByRef e As EventArgs ) As LRESULT
   ? "check mousedown", sender.CheckState, iif(sender.CheckState=1, "Checked", "UnChecked")
   Function = 0
End Function

''
''
Function Form1_Check1_MouseUp( ByRef sender As wfxCheckBox, ByRef e As EventArgs ) As LRESULT
   ? "check mouseup", sender.CheckState, iif(sender.CheckState=1, "Checked", "UnChecked")
   Function = 0
End Function


Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

SeaVipe


Thanks Paul,


frmMain has an existing checkbox with the following code:



'' frmMain

Function frmMain_chkHere_Click( ByRef sender As wfxCheckBox, ByRef e As EventArgs ) As LRESULT
    ? "sender.CheckState"; sender.CheckState
   Function = 0
End Function


'' In a separate Module, called from frmMain_Load
With frmMain
        Dim as Long c = .BackColor

        .chkHere.BackColor = c ''
        .chkHere.Enabled = True
        .chkHere.Text = "Check to Edit text"
End With





With frmMain.chkHere unchecked (in Designer) running the app prints as per image1 showing 2 Click events that didn't happen. The first is there at program startup and the second event prints when the form loses focus or the focus is moved to a different control on the form.


Click chkHere results in image2, showing 5 Click Events when there was only 1.
Click chkHere a second time - to uncheck and then move focus to the console for print screen and there are now 8 events with just 2 clicks.


This line from the separate module is the culprit in the first click event .chkHere.Enabled = True. the other 2 lines have no other effect than to set the backcolor and text.


Also, setting chkHere to Enabled in Designer will result in image1 at program start. So setting Enabled = True fires a Click Event.

Clive Richey

Paul Squires

Okay I think the problem is that I am working from a corrected version of the library code whereas you do not have the new version yet. CheckBox and OptionButton BN_CLICKED notifications were not being registered correctly. This was brought up in a prior forum post somewhere. Here are the changes that are forthcoming in 1.8.2:

Version 1.8.2
- Added: CMaskedEdit control (from the WinFBX Library framework).
- Added: ComboBox control.
- Added: Code editor Calltips for the Frame control.
- Fixed: CheckBox and OptionButton now correctly test for BN_CLICKED notification.
- Fixed: "Custom Color" label in the PropertyList color picker would not disply properly in WinFBE64.
- Fixed: Pressing TAB key in the Replace popup form (Ctrl+R) will now move keyboard input focus between the Find and Replace textboxes.
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

SeaVipe

Clive Richey

Paul Squires

I should have the next update out as early as tomorrow. I just finished the documentation conversion to markup.
(Markup is sooooooo easy to use and it produces great looking documentation).
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer