TBTNBMP:CHECKTHEME() Error BASE/1066 Argument: conditional

TBTNBMP:CHECKTHEME() Error BASE/1066 Argument: conditional

Postby concentra » Thu Dec 10, 2015 7:18 pm

Hi.
I need some help.
Migrating from an old FW version to 2015/10 MinGW found a problem with bitmapped buttons.
The following code used to work but now rises this error:
Code: Select all  Expand view
Application
===========
   Path and name: c:\work\FWTeste.exe (32 bits)
   Size: 5,194,380 bytes
   Compiler version: Harbour 3.2.0dev (r1508011114)
   FiveWin  Version: FWH 15.10
   Windows version: 6.2, Build 9200

   Time from start: 0 hours 0 mins 0 secs
   Error occurred at: 12/10/15, 17:10:10
   Error description: Error BASE/1066  Argument error: conditional
   Args:
     [   1] = U  

Stack Calls
===========
   Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:CHECKTHEME( 0 )
   Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:REDEFINE( 0 )
   Called from: FWTeste.PRG => MAIN( 32 )
 

Reduced sample code:
Code: Select all  Expand view
# INCLUDE "fivewin.ch"

/*****/
FUNCTION Main()
/*****/

LOCAL cGet := "    "
LOCAL lOk
LOCAL oDlg

   DEFINE DIALOG oDLG RESOURCE 4303

   REDEFINE GET oGET     VAR cGET       ID 113  OF oDLG

   TBtnBmp():ReDefine( 1,;                                  //nId,;
                       "btnYes",;                           //cResName1,;
                       ,;                                   //cResName2,;
                       ,;                                   //cBmpFile1,;
                       ,;                                   //cBmpFile2,;
                       ,;                                   //cMsg,;
                       { || oDLG:END() } ,;                 //bAction,;
                       oDLG ,;                              //oBar,;
                       ,;                                   //lAdjust,;
                       ,;                                   //bWhen,;
                       ,;                                   //lUpdate,;
                       ,;                                   //cToolTip,;
                       "Ok",;                               //cPrompt,;
                       ,;                                   //oFont,;
                       ,;                                   //cResName3,;
                       ,;                                   //cBmpFile3,;
                       ,;                                   //lBorder,;
                       "LEFT" )                             //cLayout,;
                                                            //cResName4,;
                                                            //cBmpFile4,;
                                                            //lTransparent,;
                                                            //lRound,;
                                                            //bGradColors )

   ACTIVATE DIALOG oDLG CENTER

Return NIL 

RC File:
Code: Select all  Expand view
#include "winuser.h"
#include "winnt.h"
#include "commctrl.h"

LANGUAGE LANG_PORTUGUESE,SUBLANG_PORTUGUESE_BRAZILIAN

4303 DIALOGEX 36,25,384,333
CAPTION "Altera"
FONT 8,"MS Sans Serif",0,0,0
STYLE WS_POPUP|WS_VISIBLE|WS_CAPTION|WS_SYSMENU|DS_MODALFRAME|DS_3DLOOK
BEGIN
  CONTROL "",113,"Edit",WS_VISIBLE|WS_BORDER|WS_TABSTOP|ES_PASSWORD,149,28,51,13
  CONTROL "Button",1,"Button",WS_VISIBLE|WS_TABSTOP|BS_DEFPUSHBUTTON,244,312,54,17
END 


Regards,
Maurício Ventura Faria
User avatar
concentra
 
Posts: 124
Joined: Mon Nov 14, 2005 10:15 am
Location: Brazil

Re: TBTNBMP:CHECKTHEME() Error BASE/1066 Argument: conditional

Postby Enrico Maria Giordano » Thu Dec 10, 2015 8:07 pm

Maurício,

between cLayout and cResName4 there is l2007.

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

Re: TBTNBMP:CHECKTHEME() Error BASE/1066 Argument: conditional

Postby concentra » Thu Dec 10, 2015 11:47 pm

Hi Enrico, thanks for your attention.
Enrico Maria Giordano wrote:between cLayout and cResName4 there is l2007.

Reviewing, I saw it in the code. But since this parameter is not passed I am afraid this is not relevant.
Does this sample code run in your environment ?

Regards,

Maurício Ventura Faria
User avatar
concentra
 
Posts: 124
Joined: Mon Nov 14, 2005 10:15 am
Location: Brazil

Re: TBTNBMP:CHECKTHEME() Error BASE/1066 Argument: conditional

Postby Antonio Linares » Fri Dec 11, 2015 8:47 am

Mauricio,

If you code it this way then it properly works:

REDEFINE BTNBMP oBtn PROMPT "Ok" ID 1 OF oDlg ACTION oDlg:End()

Looking at the .ppo file we get:

oBtn := TBtnBmp():ReDefine( 1,,,,,, {|Self|oDlg:End()}, oDlg, .F.,, .F.,, "Ok",,,,,, .F.,,, .F., !.F., )

it looks different from yours
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42076
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: TBTNBMP:CHECKTHEME() Error BASE/1066 Argument: conditional

Postby concentra » Fri Dec 11, 2015 9:30 am

Hi Antonio,
Antonio Linares wrote:If you code it this way then it properly works:

REDEFINE BTNBMP oBtn PROMPT "Ok" ID 1 OF oDlg ACTION oDlg:End()

Looking at the .ppo file we get:

oBtn := TBtnBmp():ReDefine( 1,,,,,, {|Self|oDlg:End()}, oDlg, .F.,, .F.,, "Ok",,,,,, .F.,,, .F., !.F., )

it looks different from yours

This used to work and I use this syntax a lot.
The problem seems to be introduced by the lTransparent property that is not properly set to the default value when the ReDefine method is called.
The New and NewBar methods do.

Regards.
Last edited by concentra on Fri Dec 11, 2015 9:41 am, edited 1 time in total.
User avatar
concentra
 
Posts: 124
Joined: Mon Nov 14, 2005 10:15 am
Location: Brazil

Re: TBTNBMP:CHECKTHEME() Error BASE/1066 Argument: conditional

Postby Antonio Linares » Fri Dec 11, 2015 9:38 am

Mauricio,

Ok, we can fix it. Thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42076
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: TBTNBMP:CHECKTHEME() Error BASE/1066 Argument: conditional

Postby nageswaragunupudi » Fri Dec 11, 2015 2:36 pm

Please add lTransparent := .f. to the list of defaults. We'll also do the same in the libs.

That solves the issue for this application in this case.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 112 guests