Checkbox still strange

Re: Checkbox still strange

Postby James Bott » Tue Nov 09, 2010 2:51 pm

Tim,

Have you tried linking in the ver 10.6 control.prg with the 10.7 FWH version. This would confirm that the problem is in the control.prg code and not elsewhere.

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Checkbox still strange

Postby TimStone » Tue Nov 09, 2010 6:49 pm

lTransparent is .t. for the keyclick.

I understand your question. I have to do this soft of evaluation all the time. Often a client has a problem I can't duplicate.

However, the reality is that something changed. If I simply substituted in the 10.06 control.prg, the problem goes away.

I am going to try adding in the changes one section at a time to the 10.06 code until the problem starts ... then I can tell you exactly !
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2950
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Checkbox still strange

Postby TimStone » Tue Nov 09, 2010 7:21 pm

This is the offending code:

case nMsg == WM_LBUTTONDOWN
if ::lTransparent .and. ( ::IsKindOf( "TRADIO" ) .or. ::IsKindOf( "TCHECKBOX" ) )
::oWnd:Refresh( .f. )
endif
return ::LButtonDown( nHiWord( nLParam ), nLoWord( nLParam ), nWParam )


The changes to WM_UPDATEUISTATE and the addition of WM_LBUTTONUP are fine. Howevever, with LBUTTONDOWN I'm having to double click the checkboxes. Also setting the default to lTransparent to .f. is not a problem. The only other change in the code was with the FOLDER, and that is not a problem.

So, the need to double click a checkbox is limited to the above addition made to 10.07. Any thoughts on why or what is wrong ?
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2950
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Checkbox still strange

Postby Enrico Maria Giordano » Tue Nov 09, 2010 7:55 pm

Try replacing

Code: Select all  Expand view  RUN
::oWnd:Refresh( .f. )


with

Code: Select all  Expand view  RUN
::oWnd:Refresh()


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8725
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Checkbox still strange

Postby TimStone » Tue Nov 09, 2010 8:14 pm

It still requires a double click, but the flash returns !
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2950
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Checkbox still strange

Postby Enrico Maria Giordano » Tue Nov 09, 2010 9:27 pm

Ok. Is the problem solved without side effects if you completely remove the case WM_LBUTTONDOWN?

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8725
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Checkbox still strange

Postby TimStone » Wed Nov 10, 2010 6:05 pm

James,

As you probably saw from the additional posts, I was able to isolate the problem to the WM_LBUTTONDOWN case in the event handler. Yes, it was added in 10.7, and not present in 10.6. All other changes in 10.7 were fine and did not cause a problem. Those same changes exist through 10.10.

EMG

Yes, if I comment out WM_LBUTTONDOWN from the 10.10 ( or previous ) version of FWH, then the problem goes away.

I'm wondering if there is a variable name in conflict in the classes. The problem is that this occurs consistently in some dialogs, on every checkbox. In other dialogs, it does not occur. It is always the same dialogs, and it is universal within them. That is why I can't give you a sample.

Why was the WM_LBUTTONDOWN added ? Perhaps I can better get this resolved if I knew the reason it was necessary in 10.7 when it worked fine without these changes in all previous versions. The solution to the problem probably lies within this reason.

Thanks.

Tim
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2950
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Checkbox still strange

Postby Enrico Maria Giordano » Wed Nov 10, 2010 6:53 pm

Maybe this:

* Fix: samples\GradBrus.prg was failing when Alt was pressed or the mouse was clicked on a
radio or a checkbox. We have modified Class TControl Method HandleEvent() to solve it.


Can you try to take one of your dialogs showing the problem, extract it from your app, make the extracted code self-contained and then show us the resulting code?

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8725
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Checkbox still strange

Postby James Bott » Wed Nov 10, 2010 7:11 pm

Tim,

CONTROL "Core", 750, "Button", BS_AUTOCHECKBOX|WS_TABSTOP, 80, 220, 40, 13


I still wonder about the above. What is a "core" control? Then it seems to be defined as both a button and a checkbox. Where did you get this syntax?

Perhaps your syntax was only working before because there was a bug in the FW code and now that the bug has been fixed it doesn't work.

I wonder why you are getting an error when trying to use a standard checkbox control. As Enrico mentioned, I think it would help if we could see the code for one of the dialogs that is giving you the problem. I would also like to see the preprocessor output.

You mentioned varaible name conflicts; are you using publics and/or privates?

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Checkbox still strange

Postby Enrico Maria Giordano » Wed Nov 10, 2010 7:24 pm

James Bott wrote:I still wonder about the above. What is a "core" control?


James, you have misunderstood: "Core" is the label, "Button" is the control type. :-)

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8725
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Checkbox still strange

Postby TimStone » Wed Nov 10, 2010 8:22 pm

I did better then I thought.

Here is a "cut down" dialog

Code: Select all  Expand view  RUN

#INCLUDE "fivewin.ch"
#INCLUDE "tdata.ch"
#INCLUDE "wcolors.CH"
#INCLUDE "xbrowse.CH"


FUNCTION TestInv

    // Declare PRIVATE variables
    PRIVATE oDiw, oInv, oInvr, oLbxin                   // Main dialog object

    // Open the inventory database  and set the index to part number order
    oInv := tdata():new(, "einmst" )
    IF !oInv:use()
        MsgAlert( "Inventory file could not be opened" )
        RETURN nil
    ENDIF
    oInv:setorder( "einnum" )
    oInv:gotop()
 
  // Create the tRecord for editing
  oInvr:= TRecord():new( oInv )

    // Create the editor dialog
    DEFINE DIALOG oDiw RESOURCE "PRO2100" TRANSPARENT // BRUSH oBrush TRANSPARENT

    REDEFINE CHECKBOX oInvr:invcof ID 750 OF oDiw ;
        MESSAGE "Does this part have cores attached ?" UPDATE
    REDEFINE CHECKBOX oInvr:invtxf ID 749 OF oDiw ;
        MESSAGE "Is this part generally taxable ?" UPDATE
    REDEFINE CHECKBOX oInvr:invtyp  ID 748 OF oDiw ;
        MESSAGE "Is this a stocking part ?"  UPDATE
    REDEFINE CHECKBOX oInvr:invapa ID 747 OF oDiw ;
        MESSAGE "Should there be a parts kit attached to this item ? " UPDATE
 
    // Create the browse control
    REDEFINE XBROWSE oLBxin ID 716 OF oDiw ON CHANGE ( oInvr:load(), oDiw:update() ) UPDATE
    oLbxin:setoDBF( oInv )
    add to oLbxin header "Part" data oInv:invnum ALIGN LEFT
    add to oLbxin Header "Description" data oInv:invdes ALIGN LEFT
    add to oLbxin header "Cross Ref." data oInv:invcod ALIGN LEFT
    add to oLbxin header "On Hand" data oInv:invstk ALIGN RIGHT PICTURE "9999.99"
    add to oLbxin Header "Charge" data oInv:invchg ALIGN RIGHT PICTURE "99,999.99"
    add to oLbxin Header "Location" data oInv:invloc ALIGN LEFT
    add to oLbxin Header "Manufacturer" data oInv:invman ALIGN LEFT

    // Activate the dialog screen
    ACTIVATE DIALOG oDiw ON PAINT oLbxin:setfocus() ON INIT ( oDiw:center(wndmain()) )
   
RETURN NIL


 


Code: Select all  Expand view  RUN

// RESOURCE SCRIPT FOR ASW9  Updated:  09/2009 to 11/2009

#include <windows.h>
#include <commctrl.h>
#include <richedit.h>
#include "asw8.h"
#include "c:\fwh\include\WinApi.ch"

1 24 "WindowsXP.Manifest"

LANGUAGE LANG_ENGLISH,SUBLANG_ENGLISH_US

PRO2100 DIALOG DISCARDABLE 0, 0, 660, 175
STYLE WS_POPUP|DS_MODALFRAME|WS_CAPTION|WS_VISIBLE
CAPTION "Checkbox Test Program"
FONT 8, "Arial"
BEGIN
  CONTROL "", 716, "TXBrowse", WS_TABSTOP|0x00a00000, 5, 30, 650, 135
  CONTROL "Tax", 749, "Button", BS_AUTOCHECKBOX|WS_TABSTOP, 10, 5, 40, 13
  CONTROL "Stock", 748, "Button", BS_AUTOCHECKBOX|WS_TABSTOP, 60, 5, 40, 13
  CONTROL "Core", 750, "Button", BS_AUTOCHECKBOX|WS_TABSTOP, 110, 5, 40, 13
  CONTROL "List", 747, "Button", BS_AUTOCHECKBOX|WS_TABSTOP, 160, 5, 32, 13
 
END

 


The code is built into an .exe using FWH 10.10 and xHabour ( xBuilder /xCC ). If I make the KEYDOWN change to Control.prg, it works fine. Without it, the checkboxes require a double click. I am using database objects and you will see an xBrowse also present.
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2950
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Checkbox still strange

Postby Enrico Maria Giordano » Wed Nov 10, 2010 8:56 pm

I can't compile your sample but I see at least one error:

TimStone wrote:
Code: Select all  Expand view  RUN
ON PAINT oLbxin:setfocus()


What do you want to achieve using that line?

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8725
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Checkbox still strange

Postby James Bott » Wed Nov 10, 2010 9:30 pm

Enrico,

James, you have misunderstood: "Core" is the label, "Button" is the control type.


OK, I see.

But why use a button as a ckeckbox?

Then he uses REDEFINE CHECKBOX in his code. Maybe this is a problem?

The Checkbox class is a subclass of TControl, so I don't understand the relationship with the button class.

I'm confused.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Checkbox still strange

Postby Enrico Maria Giordano » Wed Nov 10, 2010 9:45 pm

These two lines are equivalent:

Code: Select all  Expand view  RUN
CONTROL "Core", 750, "Button", BS_AUTOCHECKBOX|WS_TABSTOP, 80, 220, 40, 13

Code: Select all  Expand view  RUN
AUTOCHECKBOX "Core", 750, 80, 220, 40, 13, BS_AUTOCHECKBOX | WS_TABSTOP


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8725
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Checkbox still strange

Postby Enrico Maria Giordano » Wed Nov 10, 2010 9:46 pm

James Bott wrote:But why use a button as a ckeckbox?


A checkbox is a kind of button.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8725
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

PreviousNext

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 32 guests

cron