Try this
SetProperty( cForm, cImage, 'Picture', a_Digit[nNr+1] )
Moderator: Rathinagiri
Try this
Code: Select all
0, 0, bm.bmWidth, bm.bmHeight
Code: Select all
if (nMode == BMP_COPY_SPLIT)
{
rect.bottom = hb_parnl (6);
rect.right = hb_parnl (7);
aSource.top = hb_parnl (8);
aSource.left = hb_parnl (9);
aSource.bottom = hb_parnl (10);
aSource.right = hb_parnl (11);
StretchBlt(hDC, rect.left, rect.top, rect.right, rect.bottom, memDC, aSource.left, aSource.top, aSource.right, aSource.bottom, SRCCOPY);
}
Code: Select all
hBitmap := BMP_LOAD_FILE("COLORS.BMP")
wide := BMP_GET_INFO (hBitmap, BMP_INFO_WIDTH)
height := BMP_GET_INFO (hBitmap, BMP_INFO_HEIGHT)
FOR i = 1 TO iMax
cForm := "Form_"+strzero(i, 2)
cOnPaintProc := "Paint_Background_Window( '" + cForm + ;
"', '" + str(i) + ;
"', '" + str(wide) + ;
"', '" + str(height) + ;
"', '" + str(hBitmap)+ "' )"
DEFINE WINDOW &cForm ;
...
ON PAINT &cOnPaintProc ;
Code: Select all
FUNCTION Paint_Background_Window(cForm,cID,cwide,cheight,cBitmap)
LOCAL hWnd
LOCAL hBitmap
LOCAL nMode := BMP_COPY_SPLIT
LOCAL Row := 0
LOCAL Col := 0
Local wide := 32
Local height := 35
Local nPart := 0
nNo := VAL(cID )
wide := VAL(cwide )
height := VAL(cheight)
hBitmap := VAL(cBitmap)
nPart := ROUND(wide/8,0)-1
hWnd := GetFormHandle(cForm)
Row := GetProperty(cForm ,"Height")
Col := GetProperty(cForm ,"Width" )
BMP_PAINT (hWnd, hBitmap, nMode,0,0,Row,Col,;
0,nPart*(nNo-1),height,nPart)
RETURN NIL
Thank you, surely our friend and collaborator in Grigory Filatov will ask you for permission to add it to HMG Extended
Thank you for sharing, nice creation
it is true that my Question most are API Question but it is not the API itself it is how it work with HMGdanielmaximiliano wrote: ↑Tue Nov 26, 2019 10:04 am There are times when there are no answers because nobody had the need for some features you are using.
Master Claudio Soto is also not here since Bostaurus one of the great features of HMG is not participating lately.
Code: Select all
BMP_BAND1.Label_1.value := "ABC"
Code: Select all
hWnd := GETHWNDFROM(BMP_BAND1.Label_1)
Demo code for List of all defined controls in a form with Control handleAUGE_OHR wrote: ↑Wed Nov 27, 2019 4:53 amlist line work butCode: Select all
BMP_BAND1.Label_1.value := "ABC"
fail with Syntax Error ... so how is the right Syntax to Get Handle of Control (not a API Question)Code: Select all
hWnd := GETHWNDFROM(BMP_BAND1.Label_1)
i guess i have to use a Macro for those Situation and that is what i want to find out before try a Big Application.
Code: Select all
# include "minigui.ch"
function main
define window sample at 0,0 width 800 height 600 title "List of all defined controls in a form" main
define label label1
row 10
col 10
width 100
value "Label 1"
end label
define textbox text1
row 10
col 110
width 120
value "Sample Text Box 1"
end textbox
define label label2
row 40
col 10
width 100
value "Label 2"
end label
define textbox text2
row 40
col 110
width 120
value "Sample Text Box 2"
end textbox
define label label3
row 70
col 10
width 100
value "Label 3"
end label
define textbox text3
row 70
col 110
width 120
value "Sample Text Box 3"
end textbox
@ 10,340 COMBOBOX Combo_1 ;
ITEMS { 'A' , 'B' , 'C' } ;
VALUE 1 ;
DISPLAYEDIT ;
ON DISPLAYCHANGE PlayBeep()
DEFINE HYPERLINK H1
ROW 40
COL 340
VALUE 'http://www.hmgforum.com/'
FONTNAME 'Arial'
FONTSIZE 9
AUTOSIZE .T.
ADDRESS 'http://www.hmgforum.com/'
HANDCURSOR .T.
END HYPERLINK
@ 80,340 DATEPICKER Date_1 ;
VALUE CTOD(' / / ') ;
TOOLTIP 'DatePicker Control'
DEFINE STATUSBAR
STATUSITEM "Item 1" ACTION MsgInfo('Click! 1') RAISED
STATUSITEM "Item 2" WIDTH 100 ACTION MsgInfo('Click! 2')
END STATUSBAR
define button action1
row 100
col 10
width 100
caption "Press here"
action dolisting()
end button
define listbox list1
row 130
col 10
width 300
height 200
end listbox
end window
sample.center
sample.activate
return nil
function dolisting
local aControls := GetWindowControls("sample")
local i := 0
sample.list1.deleteallitems()
for i := 1 to len(aControls)
sample.list1.additem(aControls[i])
next i
if sample.list1.itemcount > 0
sample.list1.value := 1
endif
return nil
//GETCONTROLTYPE( cFoco, cForm)
STATIC FUNCTION GetWindowControls(cForm)
local aControlList := {}, xx, yy
local i := 0
aadd(aControlList,"MainFormName :" + hb_valtostr(GetMainFormName()))
aadd(aControlList,"MainFormHandle :" + hb_valtostr(GetMainFormHandle()))
aadd(aControlList,"Lis of Defined Control ")
aadd(aControlList, "Cont.Type Cont.Handle Cont.Name" )
aadd(aControlList, "----------------------------------------------")
for i := 1 to len(_HMG_SYSDATA[4])
if _HMG_SYSDATA[4,i] == GetFormHandle(cForm)
if len(alltrim(_HMG_SYSDATA [2] [i] )) > 0
xx:= hb_Valtostr(GetControlHandle (_HMG_SYSDATA [2] [i],cForm))
yy := GETCONTROLTYPE( _HMG_SYSDATA [2] [i], cForm)
aadd(aControlList, yy +" "+ xx + " "+ HB_valtostr(_HMG_SYSDATA [2] [i] ))
endif
endif
next i
return (aControlList)
THX for your Code, that look ggod
Code: Select all
Controlhandle := InitLabel ( ParentForm, Caption, 0, x, y, w, h, '', 0, Nil , border , clientedge , HSCROLL , VSCROLL , TRANSPARENT , invisible , rightalign , centeralign, EndEllipses, NoPrefix )
Code: Select all
_HMG_SYSDATA [1][k] := "LABEL"
_HMG_SYSDATA [2][k] := ControlName
_HMG_SYSDATA [3][k] := ControlHandle
Code: Select all
FOR n := 1 TO 8
cLabel := "Label_"+LTRIM(STR(n))
hWnd := GetControlHandle(cLabel)
Function GetControlHandle(cName)
LOCAL aName := ACLONE(_HMG_SYSDATA[2])
LOCAL nPosi := ASCAN(aName,{|e| e = cName } )
LOCAL nHwnd := 0
IF nPosi > 0
nHwnd := _HMG_SYSDATA [3][nPosi]
ENDIF
RETURN nHwnd