I have a small image and below a get with the name of the image but the get is readonly, and two buttons at side
when I delete the image with second button the border of the image must also include the underlying get,
when I load from first button an image I restore the initial dimensions
the problem is that it doesn't refresh below the oldest border
testsample
- Code: Select all Expand view RUN
- #include "fivewin.ch"
Function test()
local oDlg,oFont,oBold
local aGet[10]
local oBtnSel[20]
local oImage
local cImgPath :=".\bitmaps\"
local cImmagine := cImgPath+UrlImage(ltrim("accessori.jpg"))
local cDefaImage:=cImgPath+UrlImage("noImage.png")
DEFINE FONT oFont NAME 'Tahoma' SIZE 0, -14
DEFINE FONT oBold NAME 'Tahoma' SIZE 0, -14 BOLD
DEFINE DIALOG oDlg SIZE 820,600 PIXEL TRUEPIXEL ;
COLOR CLR_BLACK, nRgb( 245,244,234) FONT oFont ;
TITLE "test"
@ 30, 630 XIMAGE oImage ;
FILENAME IF(empty(cImmagine),cDefaImage,cImmagine );// NOBORDER ;
SIZE 150,90 ;
OF oDlg ;
UPDATE
oImage:bRClicked := { || NIL }
oImage:ltransparent:=.t.
oImage:nUserControl :=0
@ 122, 630 GET aGet[2] VAR cImmagine SIZE 152,24 PIXEL OF oDlg READONLY
@ 30, 784 BTNBMP oBtnSel[2] FLAT SIZE 30, 24 OF oDlg PIXEL ;
COLOR nRgb(238,236,219),nRgb(238,236,219) ;
BITMAP "REP_CARICA" NOROUND;
ACTION ( oImage:setsize(155,90),oImage:refresh(),;
cImmagine:= GetImage(),oImage:SetSource( cImmagine ),;
aGet[2]:shoW(),;
aGet[2]:ctext:=UrlImage(cImmagine), aGet[2]:refresh())
@ 60, 784 BTNBMP oBtnSel[3] FLAT SIZE SIZE 30, 24 OF oDlg PIXEL ;
COLOR nRgb(238,236,219),nRgb(238,236,219) ;
RESOURCE "REP_SVUOTA" ;
TOOLTIP "Svuota" ;
ACTION ( oImage:setsize(155,110),oImage:refresh(),;
cImmagine:=cDefaImage,oImage:SetSource( cImmagine ),;
aGet[2]:Hide(),;
aGet[2]:ctext:="", aGet[2]:refresh() )
ACTIVATE DIALOG oDlg CENTERED
//--------------------------------------------------------------------------//
static Function UrlImage(curlImg)
Local aTmp
local nLevel := 1
local x
local cCad :=""
aTmp := Hb_ATokens( curlImg, "\" )
For x = Len( aTmp ) - nLevel + 1 To Len( aTmp )
cCad += AllTrim( aTmp[ x ] )
if x < Len( aTmp )
cCad += "\"
endif
Next x
return cCad
//------------------------------------------------------------------------//
static function GetImage()
local gcFile := cGetFile("PNG (*.png)| *.png|" + ;
"Bitmap (*.bmp)| *.bmp|" + ;
"JPEG (*.jpg)| *.jpg|" + ;
"GIF (*.gif)| *.gif|" + ;
"All Files (*.*)| *.*" ;
,"Per favore seleziona un file immagine", 4 )
* if ! Empty( gcFile ) .and. File( gcFile )
* oImage:LoadBmp( gcFile )
* endif
return gcFil
any solution ?