DEFINE BUTTON OF oBar RESOURCE 0xE10A

DEFINE BUTTON OF oBar RESOURCE 0xE10A

Postby Otto » Mon Mar 08, 2021 5:56 pm

Dear Mr. Rao,
Is it possible to use RESOURCE plus text for buttons?
Best regards,

Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6330
Joined: Fri Oct 07, 2005 7:07 pm

Re: DEFINE BUTTON OF oBar RESOURCE 0xE10A

Postby nageswaragunupudi » Tue Mar 09, 2021 5:36 am

Yes.
Please see
fwh\samples\lockscrn.prg
Regards

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

Re: DEFINE BUTTON OF oBar RESOURCE 0xE10A

Postby QAZWSX2K » Thu Apr 01, 2021 9:02 pm

lockscrn.prg don´t exist
Software especializado para oficinas contables con grandes volumenes de Informacion
Impresion de todos los formularios del Seniat, Dian

alex_patino74@hotmail.com
whatsapp 57+3214777217
User avatar
QAZWSX2K
 
Posts: 364
Joined: Tue Oct 25, 2005 7:06 pm
Location: Bogota - Caracas

Re: DEFINE BUTTON OF oBar RESOURCE 0xE10A

Postby nageswaragunupudi » Fri Apr 02, 2021 9:12 am

lockscrn.prg is available from FWH2004 onwards.
Regards

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

Re: DEFINE BUTTON OF oBar RESOURCE 0xE10A

Postby nageswaragunupudi » Fri Apr 02, 2021 9:15 am

This is lockscrn.prg.
To be run on Windows 10 only.
Also, I hope your FWH version is not too old.
Code: Select all  Expand view
/*
* Program to view and save Windows 10 LockScreen Images
*
*/


#include "fivewin.ch"

//----------------------------------------------------------------------------//

function Main()

   local cPath := GETENV( "userprofile" ) + "\AppData\Local\Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\LocalState\Assets\"
   local aImages  := {}
   local oWnd, oBar, oImage, cSave, nImages, n := 1

   AEval( DIRECTORY( cPath + "
*.*", "H" ), { |a| If( a[ 2 ] < 200000,, ( a[ 1 ] := cPath + a[ 1 ], AAdd( aImages, a ) ) ) } )

   ASort( aImages,,,{ |x,y| x[ 2 ] > y[ 2 ] } )
   nImages  := Len( aImages )

   DEFINE WINDOW oWnd STYLE WS_POPUP + WS_MAXIMIZE

   DEFINE BUTTONBAR oBar SIZE 32,32 LEFT
   oBar:SetColor( CLR_BLACK, CLR_BLACK )

   DEFINE BUTTON RESOURCE 0xE112 OF oBar CENTER ACTION ( If( --n < 1, n := nImages, ), oWnd:Update() )
   DEFINE BUTTON RESOURCE 0xE111 OF oBar CENTER ACTION ( n := ( n % nImages ) + 1, oWnd:Update() )
   DEFINE BUTTON RESOURCE 0xE105 OF oBar CENTER ACTION ( ;
      If( !Empty( cSave := cGetFile( "
Jpg file(*.jpg)|*.jpg|", ;
      "
Select File to Save", CurDir(), .t. ) ), ;
      HB_MEMOWRIT( cFileSetExt( cSave, "
jpg" ), MEMOREAD( aImages[ n, 1 ] ) ), MsgInfo( "Not selected" ) ) )
   DEFINE BUTTON RESOURCE FWBitmap( "
exit2" ) OF oBar CENTER ACTION oWnd:End()

   oBar:Float()

   @ 0,0 XIMAGE oImage SOURCE MEMOREAD( aImages[ n, 1 ] ) SIZE 0, 0 OF oWnd NOBORDER UPDATE
   oImage:SetColor( CLR_WHITE, CLR_BLACK )
   oImage:bLClicked := { || n := ( n % nImages ) + 1, oWnd:Update() }
   oImage:bRClicked := { || If( MsgYesNo( "
Exit program?" ), oWnd:End(), ) }

   oWnd:oClient := oImage

   ACTIVATE WINDOW oWnd MAXIMIZED

return nil

//----------------------------------------------------------------------------//
Regards

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

Re: DEFINE BUTTON OF oBar RESOURCE 0xE10A

Postby cnavarro » Fri Apr 02, 2021 1:03 pm

Otto wrote:Dear Mr. Rao,
Is it possible to use RESOURCE plus text for buttons?
Best regards,

Otto

Dear Otto
Do you want to say something like this?
Image
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6541
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: DEFINE BUTTON OF oBar RESOURCE 0xE10A

Postby nageswaragunupudi » Fri Apr 02, 2021 2:10 pm

I understood from Mr. Cristobal's posting the I did not understand Mr. Otto's question correctly.

Answer to Mr. Ottos question is,

Yes.

Eg:
Code: Select all  Expand view
  @ 20,20 BTNBMP PROMPT "NEXT" RESOURCE 0xE111 SIZE 100,100 PIXEL 2007 OF oDlg
 


Image
Regards

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], Jimmy and 65 guests