Page 1 of 1
GET logical value represented by bitmap
Posted: Wed May 22, 2019 6:47 pm
by reds
Any examples where a GET of a logical field is being substituted with a on/off yes/no etc bitmaps
Thanks
Peter
Re: GET logical value represented by bitmap
Posted: Thu May 23, 2019 1:06 am
by nageswaragunupudi
Use CHECKBOX or SWITCH controls instead of GET
Re: GET logical value represented by bitmap
Posted: Fri May 24, 2019 8:28 am
by reds
I've used BTNBMP
Regards
Peter
Re: GET logical value represented by bitmap
Posted: Fri May 24, 2019 8:43 am
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

regards
Uwe

Re: GET logical value represented by bitmap
Posted: Fri May 24, 2019 5:50 pm
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 | Expand
#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 | Expand
// 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
}
Re: GET logical value represented by bitmap
Posted: Fri May 24, 2019 6:38 pm
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

Re: GET logical value represented by bitmap
Posted: Mon May 27, 2019 8:53 am
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