GET logical value represented by bitmap

GET logical value represented by bitmap

Postby reds » Wed May 22, 2019 6:47 pm

Any examples where a GET of a logical field is being substituted with a on/off yes/no etc bitmaps
Thanks
Peter
reds
 
Posts: 50
Joined: Tue May 16, 2017 12:19 pm
Location: North London

Re: GET logical value represented by bitmap

Postby nageswaragunupudi » Thu May 23, 2019 1:06 am

Use CHECKBOX or SWITCH controls instead of GET
Regards

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

Re: GET logical value represented by bitmap

Postby reds » Fri May 24, 2019 8:28 am

I've used BTNBMP
Regards
Peter
reds
 
Posts: 50
Joined: Tue May 16, 2017 12:19 pm
Location: North London

Re: GET logical value represented by bitmap

Postby ukoenig » Fri May 24, 2019 8:43 am

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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: GET logical value represented by bitmap

Postby reds » Fri May 24, 2019 5:50 pm

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 view

#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 view
// 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
}

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

Re: GET logical value represented by bitmap

Postby ukoenig » Fri May 24, 2019 6:38 pm

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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: GET logical value represented by bitmap

Postby reds » Mon May 27, 2019 8:53 am

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
reds
 
Posts: 50
Joined: Tue May 16, 2017 12:19 pm
Location: North London


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: wilsongamboa and 42 guests