GET logical value represented by bitmap

Post Reply
reds
Posts: 50
Joined: Tue May 16, 2017 12:19 pm
Location: North London

GET logical value represented by bitmap

Post by reds »

Any examples where a GET of a logical field is being substituted with a on/off yes/no etc bitmaps
Thanks
Peter
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: GET logical value represented by bitmap

Post by nageswaragunupudi »

Use CHECKBOX or SWITCH controls instead of GET
Regards

G. N. Rao.
Hyderabad, India
reds
Posts: 50
Joined: Tue May 16, 2017 12:19 pm
Location: North London

Re: GET logical value represented by bitmap

Post by reds »

I've used BTNBMP
Regards
Peter
User avatar
ukoenig
Posts: 3981
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Re: GET logical value represented by bitmap

Post by ukoenig »

Peter
the solution You are looking for :?:
GET and a btnbmp ( with image-switch )
I've used BTNBMP
display any info like ".T." or ".F." ( as string ) inside a get

the image is displayed as yes or no and belongs to a selected logical var-status

Image

regards
Uwe :D
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
reds
Posts: 50
Joined: Tue May 16, 2017 12:19 pm
Location: North London

Re: GET logical value represented by bitmap

Post by reds »

Thanks Uwe
I will try it out

The bitmap is working and from code there is no border, which was I want but from resource it keeps the border


Regards
Peter

Code: Select all

#Include "FiveWin.Ch"
 
Function Main()
 Local oDlg,oBtn
 LOCAL lFlag := .f.
      DEFINE DIALOG oDlg RESOURCE 1001
       REDEFINE  BTNBMP oBtn  ID 4001 NOBORDER  OF oDlg  ;
        FILE  IIF( lFlag, "..\bitmaps\on.bmp", "..\bitmaps\off.bmp"  ) ;
        ACTION ( lFlag := ! lFlag, oBtn:loadbitmaps( IIF(lFlag, "..\bitmaps\on.bmp", "..\bitmaps\off.bmp" )),obtn:refresh() )
        
       ACTIVATE DIALOG oDlg 
return nil
 

Code: Select all

// RESOURCE SCRIPT generated by "Pelles C for Windows, version 8.00".

#include <windows.h>
#include <commctrl.h>
#include <richedit.h>
#include "resource.h"

LANGUAGE LANG_ENGLISH,SUBLANG_ENGLISH_US

1001 DIALOGEX DISCARDABLE 6, 18, 210, 142
STYLE DS_SHELLFONT|WS_POPUP|DS_MODALFRAME|DS_CONTEXTHELP|DS_3DLOOK|WS_CAPTION|WS_SYSMENU|WS_VISIBLE
CAPTION "Dialog"
FONT 8, "Tahoma"
{
  CONTROL "", 4001, "Button", BS_BITMAP|BS_OWNERDRAW|BS_FLAT|WS_TABSTOP, 65, 65, 50, 14, WS_EX_TRANSPARENT
}

 
User avatar
ukoenig
Posts: 3981
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Re: GET logical value represented by bitmap

Post by ukoenig »

In the meantime just try

REDEFINE BTNBMP oBtn ID 4001 NOBORDER OF oDlg ;
FILE IIF( lFlag, "..\bitmaps\on.bmp", "..\bitmaps\off.bmp" ) ;
ACTION ( lFlag := ! lFlag, ;
::SetImages( If( lFlag, "..\bitmaps\on.bmp", ;
"..\bitmaps\off.bmp" ) ) )


METHOD ReDefine( nId, cResName1, cResName2, cBmpFile1, cBmpFile2,;
cMsg, bAction, oBar, lAdjust, bWhen, lUpdate,;
cToolTip, cPrompt, oFont, cResName3,;
cBmpFile3, lBorder , cLayout, cResName4, cBmpFile4, lTransparent,;
lRound, bGradColors )

regards
uwe :D
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
reds
Posts: 50
Joined: Tue May 16, 2017 12:19 pm
Location: North London

Re: GET logical value represented by bitmap

Post by reds »

using NOBORDER or lborder := .f. has the same result
i.e.
when the mouse is over the bitmap the border appears but when created from code it doesn't

Regards
Peter
Post Reply