HotSpot-Editor Release 2.2 => UPDATE

HotSpot-Editor Release 2.2 => UPDATE

Postby ukoenig » Sat Aug 13, 2011 12:21 am

Hello,

The new Hotspot-editor is ready for Download.
Because the Project has grown to a big Tool, there is something to explain of the
Basic Functions
( let me know, if something is still missing or not working !
Maybe some more Ideas ?
) :

1. Create single and Multiple Hotspots
2. You can use any Background-image for Window and Dialog
3. Creates a PRG and EXE-file
4. Easy, to add / include multiple Hotspots to a created Main-prg
5. Can be a Tooltip ( autoclose after leaving the Hotspotarea )
or used as Message ( stayes on Screen with Button-actions )
6. Defined Dialog-size
7. Defined Shadow-size


Buttons and Sliders :
1. Shadowsize 0 - 20
2. Autoclose ON / OFF defines the behavior Tooltip or Message with Action
3. Hotspot opens a Multiline-Get with ELSEIF-part for multiple Hotspots
4. Edit creates a PRG- and EXE-file ( to be selected BEFORE creating a PRG )
5. 2 Gets for Dialog-size
6. Dialog ( View ) opens a Dialog to define Hotspots
7. Dialog ( Paint ) selects a Dialog-Background-Image
8. Windows ( Paint ) selects a Window-Background-Image

To compile a Prg, please check the RMK-files

Download ( 6.8 MB ):
http://www.pflegeplus.com/fw_downloads/Hotspot1.zip

To create Hotspots on Your own Images, please copy them
to the Subdir : ./Images

To test Hotspots on a Mainwindow, I added some Frames on the Images

Image

Hotspots on Dialog.

Image

To add multiple Hotspots to Your PRG
copy / paste the ELSEIF of the Multiline-Get inside one of the Functions.
There are 2 different ones, one for Window T_DISPLAY1(nRow, nCol)
and 1 for Dialog T_DISPLAY2(nRow, nCol) :

Image

A multiple Hotspot-sample ( Windows ) :

Code: Select all  Expand view

FUNCTION T_DISPLAY1(nRow, nCol)

IF nRow >= 186 .and. nRow <= 353 .and. nCol >= 234 .and. nCol <= 418 // 1. Hotspot
    IF lMessage1 = .F.
        lMessage1 := .T.
        SHOW_MSG1( 1,186, 353, 234, 418, ;
                "HeadLine Hotspot 1", ;
                "Top : 186 ", ;
                "Left :  234 ", ;
                "Bottom : 353 ", ;
                "Right : 418 ")
    ENDIF
ELSEIF nRow >= 593 .and. nRow <= 641 .and. nCol >= 825 .and. nCol <= 964 // 2. Hotspot
     IF lMessage1 = .F.
          lMessage1 := .T.
         SHOW_MSG1( 1, 593, 641, 825, 964, ;
               "HeadLine Hotspot 1", ;
               "Top : 593 ", ;
               "Left :  825 ", ;
               "Bottom : 641 ", ;
               "Right : 964 ")
     ENDIF
ELSEIF lMessage1 = .T.
    oBar1:End()         // delete to force a Message to stay on Screen
    lMessage1 := .F.  // delete to force a Message to stay on Screen
ENDIF

RETURN ( NIL )
 


@ 40, 100 SAY oSay1 PROMPT "Tooltip on SAY" of oDlg SIZE 60, 20 FONT oTxtfont COLOR CLR_WHITE PIXEL TRANSPARENT ADJUST

Image

Best Regards
Uwe :lol:
Last edited by ukoenig on Tue Aug 16, 2011 11:11 pm, edited 2 times in total.
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: HotSpot-Editor Release 1.2 => DOWNLOAD + UPDATE

Postby RAMESHBABU » Mon Aug 15, 2011 1:15 am

Hi Uwe and Friends,

Can you please help me with the code to select a particular area of the image
and to crop the selection, as shown in the sample ?

I would be happy it the Selection is similar to the controls we get when we use
DSESIGN clause in FW Controls or as shown in the Sample.

Sample:

Image

My Best regards to you,

- Ramesh Babu P
User avatar
RAMESHBABU
 
Posts: 624
Joined: Fri Oct 21, 2005 5:54 am
Location: Secunderabad (T.S), India

Re: HotSpot-Editor Release 1.2 => DOWNLOAD

Postby ukoenig » Mon Aug 15, 2011 5:57 pm

Ramesh,

I'm still busy with testing my new Image-converter.
With the Tool You can do the Things like Image-crop and much more,
from inside Your application.

Please give me still a little bit Time for testing.

Image

Image

Best Regards
Uwe :lol:
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: HotSpot-Editor Release 2.2 => UPDATE

Postby ukoenig » Tue Aug 16, 2011 10:29 pm

Update 0.7 MB ( only Exe ):
http://www.pflegeplus.com/fw_downloads/hotspot3.zip

What's new :
A Selection, to work on a Dialog-Screen-Capture without Dialog-head and left-border ( moves Brush )
to get the real nRow- and nCol-positions in Relation to the original Dialog.

Image

Image

Ramesh,

Cropping Images :

viewtopic.php?f=3&t=22178

I added Tooltips to the original FWH-Sample Testsay.prg
The supplemented Sample shows, how to use just 1 Tooltip
on 3 different Dialogs

Image

Code: Select all  Expand view

#include "FiveWin.ch"
#include "ttitle.ch"

STATIC lMessage1 := .F., nDlg := 1, oBar1, oTextFont, oSysFont1, oSysfont2, c_path

function Main()

local oWnd
local oMenu

menu oMenu
   menuitem "Gradient" action Dlg_Grad()
   menuitem "Color" action Dlg_Color()
   menuitem "Bitmap" action Dlg_Bit()
endmenu

oTextfont := TFont():New( "Arial", 0, 14,.F.,.T.,  0,  0,  0,.F.,.F.)
oSysfont1 := TFont():New( "Arial", 0, 16,.F.,.T.,  0,  0,  0,.F.,.F.)
oSysfont2 := TFont():New( "Arial", 0, 22,.F.,.T.,  0,  0,  0,.F.,.F.)
c_path := CURDRIVE() + ":\" + GETCURDIR()

DEFINE WINDOW oWnd TITLE "
Test Say" from 0,0 to 400,800 pixel menu oMenu

activate window oWnd

oTextfont:End()
oSysFont1:End()
oSysfont2:End()

return nil

procedure Dlg_Grad

local oDlg1
local oSay
local oSay2

define dialog odlg1 title "
Test Say With Gradient Brush" size 400,400 PIXEL TRANSPARENT
   
@ 2,2 to 100,100 of odlg1 pixel
   
 @ 25,15 say oSay prompt "
This a Test" of oDlg1 SIZE 40, 15 COLOR CLR_WHITE PIXEL adjust ;
 FONT oTextfont

oDlg1:bLClicked := {| nRow, nCol | ( IIF( lMessage1 = .T., oBar1:End(), NIL ), ;
                                                           MsgAlert( "
Your Action !","Attention" ) ) }

oDlg1:bMMoved := {| nRow, nCol | T_DISPLAY1(nRow, nCol, oDlg1, 1) }

@ 10,120 button "
Test" pixel action  ( oSay:SetText( "Change Text"), oDlg1:Refresh() )  

   
ACTIVATE DIALOG oDlg1 CENTERED  ;
ON INIT DLG_BRUSH( oDlg1, .F., nRGB( 75, 144, 223 ), nRGB( 41, 85, 145 ), 0.4 )

// GradientBrush( oDlg, { { 0.4, nRGB( 75, 144, 223 ), nRGB( 41, 85, 145 ) },;
//                                     { 0.6, nRGB( 24,  61, 118 ), nRGB( 50, 95, 158 ) } } )
   
return

procedure Dlg_Color

local oDlg2
local oBrush
local oSay

define brush oBrush color CLR_CYAN
   
define dialog odlg2 title "
Test Say With Color Brush" brush oBrush size 400,400 PIXEL TRANSPARENT
   
@ 2,2 say oSay prompt "
This a Test" of oDlg2 SIZE 100, 130 COLOR CLR_WHITE PIXEL  transparent ;
FONT oTextfont

oDlg2:bLClicked := {| nRow, nCol | ( IIF( lMessage1 = .T., oBar1:End(), NIL ), ;
                                                           MsgAlert( "
Your Action !","Attention" ) ) }

oDlg2:bMMoved := {| nRow, nCol | T_DISPLAY1(nRow, nCol, oDlg2, 2) }

@ 10,120 button "
Test" action oSay:SetText( "Change Text")  pixel

ACTIVATE DIALOG oDlg2 CENTERED
   
   
return

procedure Dlg_Bit

local oDlg3
local oBrush
local oSay

define brush oBrush file "
..\bitmaps\cara.bmp"
   
define dialog odlg3 title "
Test Say With bitmap Brush" brush oBrush size 400,400 PIXEL TRANSPARENT
   
@ 2,2 say oSay prompt "
This a Test" of oDlg3 SIZE 100, 130 COLOR CLR_WHITE PIXEL  transparent ;
FONT oTextfont

oDlg3:bLClicked := {| nRow, nCol | ( IIF( lMessage1 = .T., oBar1:End(), NIL ), ;
                                                           MsgAlert( "
Your Action !","Attention" ) ) }

oDlg3:bMMoved := {| nRow, nCol | T_DISPLAY1(nRow, nCol, oDlg3, 3) }


@ 10,120 button "
Test" pixel action oSay:SetText( "Change Text")  

 
ACTIVATE DIALOG oDlg3 CENTERED on init osay:refresh()
   
return

// ---------- using different Dialogs --------

FUNCTION T_DISPLAY1(nRow, nCol, oDlg, nDlg)

// Dialog 2 and 3
// -------------------
IF nRow >= 5 .and. nRow <= 15 .and. nCol >= 5 .and. nCol <= 60 .and. ( nDlg = 2 .or. nDlg = 3 )
    IF lMessage1 = .F.
        lMessage1 := .T.
        SHOW_MSG1(oDlg, 1, 5, 15, 5, 60, ;
                "
Head Hotspot 2 + 3", ;
                "
Top : 5 ", ;
                "
Left :  5 ", ;
                "
Bottom : 15 ", ;
                "
Right : 60 ")
    ENDIF
// Dialog 1
// -----------
ELSEIF  nRow >= 52 .and. nRow <= 64 .and. nCol >= 30 .and. nCol <= 83 .and. nDlg = 1
     IF lMessage1 = .F.
          lMessage1 := .T.
         SHOW_MSG1( oDlg, 1, 52, 64, 30, 83, ;
               "
Head Hotspot 1", ;
               "
Top : 52 ", ;
               "
Left :  30 ", ;
               "
Bottom : 64 ", ;
               "
Right : 83 ")
     ENDIF
ELSEIF lMessage1 = .T.
         // deleting these lines,
     // Message stays open
     // ---------------------------
    oBar1:End()              
    lMessage1 := .F.
ENDIF

RETURN ( NIL )

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

FUNCTION SHOW_MSG1(oDlg, nSpot,nSTop,nSBott,nSLeft,nSRight, cHead, cText1, cText2, cText3, cText4)
Local oTitle, oText1, oText2, oText3, oText4, oBmp1, oBmp2
Local nTop := nSBott + 2, nLeft := nSRight + 2
IF nSTop + 162  > oDlg:nHeight - 50
    nTop := nSTop - 162
ENDIF
IF nSLeft + 252  > oDlg:nWidth
    nLeft := nSLeft - 252
ENDIF

@ nTop, nLeft TITLE oBar1 SIZE 250, 160 OF oDlg SHADOW BOTTOMRIGHT SHADOWSIZE 10

@ 15, 55 TITLETEXT oTitle OF oBar1 TEXT cHead FONT oSysfont2 COLOR 128

@ 50, 20 TITLETEXT oText1 OF oBar1 TEXT  cText1 FONT oSysfont1 COLOR 0
@ 75, 20 TITLETEXT oText2 OF oBar1 TEXT  cText2 FONT oSysfont1 COLOR 0
@ 100, 20 TITLETEXT oText3 OF oBar1 TEXT  cText3 FONT oSysfont1 COLOR 0
@ 125, 20 TITLETEXT oText4 OF oBar1 TEXT  cText4 FONT oSysfont1 COLOR 0

@ 10, 15 TITLEIMG oBmp1 OF oBar1 BITMAP  "
..\bitmaps\Info.BMP" SIZE 30, 30 ANIMA LEVEL 255 ;
ACTION  MsgAlert( "
Action from here !","Attention" )

oBar1:lRound := .T.
oBar1:lBorder := .T.
oBar1:nClrLine1 := 255

IF FILE( "
..\Bitmaps\Backgrnd\Stone.Bmp" )
    oBar1:aGrdBack := {}
    DEFINE BRUSH oBrush  FILENAME "
..\bitmaps\backgrnd\Stone.Bmp"
    SET BRUSH OF oBar1 TO oBrush
    RELEASE BRUSH oBrush
ELSE
    MsgAlert( "
File : Stone.Bmp" + CRLF + ;
            "
does not exist" + CRLF + ;
            "
to create Brush !", "ATTENTION" )
ENDIF

@ 100, 190 TITLEIMG oBmp2 OF oBar1 BITMAP  "
..\bitmaps\Exit.BMP" SIZE 30, 30 ANIMA LEVEL 255 ;
ACTION  ( lMessage1 := .F., oBar1:End() )

RETURN( NIL )

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

FUNCTION DLG_BRUSH( oDlg1, lDirect, nVColor, nBColor, nMove )
LOCAL hDC, oBrush, oTmp
LOCAL aRect := GETCLIENTRECT( oDlg1 )
LOCAL aGrad := { { nMove, nVColor, nBColor }, { nMove, nBColor, nVColor } }

hDC = CreateCompatibleDC( oDlg1:GetDC() )
hBmp = CreateCompatibleBitMap( oDlg1:hDC, oDlg1:nWidth, oDlg1:nHeight )
hBmpOld = SelectObject( hDC, hBmp )
GradientFill( hDC, 0, 0, oDlg1:nHeight, oDlg1:nWidth, aGrad, lDirect )
DeleteObject( oDlg1:oBrush:hBrush )
oBrush := TBrush():New( ,,,, hBmp )
oBrush:Cargo  := aGrad
SelectObject( hDC, hBmpOld )
oDlg1:ReleaseDC()
oDlg1:SetBrush( oBrush )
RELEASE BRUSH oBrush

RETURN NIL


Best Regards
Uwe :lol:
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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Silvio.Falconi and 32 guests