FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour position of an Image
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
position of an Image
Posted: Wed May 27, 2015 05:10 PM
I must change the position on bresize of a dialog

this image is on a TTitle control

I tried with oImagetitle:nLeft:=oTitle:nWidth-120

but it make error because there is not nleft valriable on ttitle image and I not found a right variable on class

How I can resolve it ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: position of an Image
Posted: Wed May 27, 2015 05:22 PM

Silvio,

oTitle:SetPos( nTop, nLeft )

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: position of an Image
Posted: Wed May 27, 2015 05:52 PM

not run

I need to move the image of the otitle

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: position of an Image
Posted: Wed May 27, 2015 07:15 PM

Silvio,

Try this:

oTitle:aImgs[ 1 ] = nRow
oTitle:aImgs[ 2 ] = nCol
oTitle:Refresh()

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: position of an Image
Posted: Thu May 28, 2015 06:52 AM
Antonio,
made error
Code (fw): Select all Collapse
Application
===========
   Path and name: E:\Modelli_Mail\test.Exe (32 bits)
   Size: 2,716,160 bytes
   Compiler version: xHarbour 1.2.3 Intl. (SimpLex) (Build 20140725)
   FiveWin  Version: FWHX 15.01
   Windows version: 5.1, Build 2600 Service Pack 3

   Time from start: 0 hours 0 mins 0 secs 
   Error occurred at: 05/28/15, 08:45:20
   Error description: Error BASE/1068  Argument error: array access
   Args:
     [   1] = N   527
     [   2] = N   3

Stack Calls
===========
   Called from: .\source\classes\TTITLE.PRG => TTITLE:PAINT( 838 )
   Called from: .\source\classes\TTITLE.PRG => (b)TTITLE:TTITLE( 133 )
   Called from:  => TTITLE:DISPLAY( 0 )
   Called from: .\source\classes\CONTROL.PRG => TTITLE:HANDLEEVENT( 1699 )
   Called from: .\source\classes\WINDOW.PRG => _FWH( 3450 )
   Called from:  => DIALOGBOXINDIRECT( 0 )
   Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 286 )
   Called from: source\test.prg => MODELLIEMAIL( 167 )


I explain you

on main I made

Code (fw): Select all Collapse
 
        @ 0,0 TITLE  oTitle OF oDlgModelli size 500, 40  SHADOW NOSHADOW GRADIENT { { 1,CLR_WHITE,LIGHTCYAN } }
        @ 10, 12 TITLETEXT OF oTitle TEXT cTitle FONT oFontBoldModelli COLOR CLR_BLACK
        @ 38, 42 TITLETEXT OF oTitle TEXT cTitle2 FONT oFontmodelli COLOR CLR_BLACK
        @ 10, oTitle:nWidth-120 TITLEIMG  oImagetitle  OF oTitle BITMAP cImageTitle TRANSPARENT



....

oDlgModelli:bResized := {||Rinfresca_oDlgModelli(oBar,oTitle,oImagetitle,oDlgModelli,oLbx,oSay,aGet ) }



....

Function Rinfresca_oDlgModelli(oBar,oTitle,oImagetitle,oDlg,oLbx,oSay,aGet )
  oTitle:nWidth:=oDlg:nWidth
        //  oTitle:aImgs[ 1 ] = oTitle:  // ???
          oTitle:aImgs[ 1 ] = oTitle:nWidth-120


  oDlg:refresh()

   return nil



a snapshot of dialog

1. first step



2. second step ( when I change the size with mouse )

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: position of an Image
Posted: Thu May 28, 2015 08:18 AM

Silvio,

This is the line where it is failing:

nBmpWidth = nBmpWidth( ::aImgs[ n, TI_HBMP ] )

I can't understand how you have these values there:

Error description: Error BASE/1068 Argument error: array access
Args:
[ 1] = N 527 !!!!!!!!
[ 2] = N 3

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: position of an Image
Posted: Thu May 28, 2015 10:44 AM
try it please
( I rem the refresh for the image on Rinfresca_oDlgModelli function )
Code (fw): Select all Collapse
#include "Fivewin.ch"
#include "constant.ch"
#include "ttitle.ch"

#define  LIGHTCYAN    nRGB( 203, 225, 252 )


Function test()
Local  nBottom   := 29.2
   Local  nRight    :=  58
   Local  nWidth    :=  Max( nRight * DLG_CHARPIX_W, 180 )
   Local  nHeight   :=  nBottom * DLG_CHARPIX_H
   Local oDlgModelli
   Local oFontmodelli,oFontBoldModelli
   Local cDlgTitle  :="Family" 

       Local oImagetitle
       Local oTitle
       Local cTitle := "Modelli e-mail"
       Local cTitle2:= "Crea nuovi modelli o personalizza quelli esistenti"
       Local cImageTitle := "MailModel.bmp"
   
   DEFINE FONT oFontmodelli NAME 'Tahoma' SIZE 0, -12
   DEFINE FONT oFontBoldModelli NAME 'Tahoma' SIZE 0, -12 BOLD

  DEFINE DIALOG oDlgModelli          ;
         SIZE nWidth, nHeight   PIXEL  TRUEPIXEL ;
         TITLE cDlgTitle 

 oDlgModelli:lHelpIcon := .F.
 oDlgModelli:nStyle    := nOr( WS_OVERLAPPED,WS_THICKFRAME,WS_SYSMENU,WS_MAXIMIZEBOX,   0  )


        @ 0,0 TITLE  oTitle OF oDlgModelli size 500, 40  SHADOW NOSHADOW GRADIENT { { 1,CLR_WHITE,LIGHTCYAN } }
        @ 10, 12 TITLETEXT OF oTitle TEXT cTitle FONT oFontBoldModelli COLOR CLR_BLACK
        @ 38, 42 TITLETEXT OF oTitle TEXT cTitle2 FONT oFontmodelli COLOR CLR_BLACK
        @ 10, oTitle:nWidth-120 TITLEIMG  oImagetitle  OF oTitle BITMAP cImageTitle TRANSPARENT

   oDlgModelli:bResized := {||Rinfresca_oDlgModelli(oTitle,oImagetitle,oDlgModelli ) }

ACTIVATE DIALOG oDlgModelli  centered
    oFontmodelli:Release()
    oFontBoldModelli:Release()

    return nil


//-----------------------------------------------------------------------------------//
Function Rinfresca_oDlgModelli(oTitle,oImagetitle,oDlg)


//title
          oTitle:nWidth:=oDlg:nWidth

//image
*  oImagetitle:nLeft:=oTitle:nWidth-120

         * oTitle:aImgs[ 1 ] = nRow
         * oTitle:aImgs[ 1 ] = oTitle:nWidth-120
           oTitle:Refresh()

 *oDlg:refresh()

   return nil
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: position of an Image
Posted: Thu May 28, 2015 10:56 AM
Antonio,
I found the solution !!!



oTitle:aImgs[1][ 2 ] = oTitle:nWidth-120
oTitle:Refresh()
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: position of an Image
Posted: Thu May 28, 2015 02:25 PM

very good :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion