PlanetSquires Forums

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: WinFBE - CheckBox  (Read 218 times)

SeaVipe

  • FireFly3 User
  • Junior Member
  • *
  • Posts: 124
  • Windows 10
WinFBE - CheckBox
« on: November 05, 2018, 12:28:03 PM »

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.
Logged
Clive Richey

Paul Squires

  • Administrator
  • Master Member
  • *****
  • Posts: 8632
  • Windows 10
    • PlanetSquires Software
Re: WinFBE - CheckBox
« Reply #1 on: November 05, 2018, 02:05:07 PM »

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.

Code: [Select]
''
''
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

Logged
Paul Squires
PlanetSquires Software
FireFly Visual Designer, WinFBE Editor

SeaVipe

  • FireFly3 User
  • Junior Member
  • *
  • Posts: 124
  • Windows 10
Re: WinFBE - CheckBox
« Reply #2 on: November 05, 2018, 03:29:02 PM »


Thanks Paul,


frmMain has an existing checkbox with the following code:


Code: [Select]
'' 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.

Logged
Clive Richey

Paul Squires

  • Administrator
  • Master Member
  • *****
  • Posts: 8632
  • Windows 10
    • PlanetSquires Software
Re: WinFBE - CheckBox
« Reply #3 on: November 05, 2018, 04:18:42 PM »

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.
Logged
Paul Squires
PlanetSquires Software
FireFly Visual Designer, WinFBE Editor

SeaVipe

  • FireFly3 User
  • Junior Member
  • *
  • Posts: 124
  • Windows 10
Re: WinFBE - CheckBox
« Reply #4 on: November 05, 2018, 04:55:39 PM »

Good stuff, thanks, Paul.
Logged
Clive Richey

Paul Squires

  • Administrator
  • Master Member
  • *****
  • Posts: 8632
  • Windows 10
    • PlanetSquires Software
Re: WinFBE - CheckBox
« Reply #5 on: November 07, 2018, 07:46:00 PM »

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).
Logged
Paul Squires
PlanetSquires Software
FireFly Visual Designer, WinFBE Editor