definition controls problem in windows
Moderator: Rathinagiri
definition controls problem in windows
Hi men.
I have still same problem. After definition window and show it, I try manipulate with control (grid, label..) Look picture from example.
I use HMG311 and minigui extended (2.1.9) with same results. "Control: xxx Of Winxxx Not defined. Program terminated,
Can You help me?
THX Dodogo
I have still same problem. After definition window and show it, I try manipulate with control (grid, label..) Look picture from example.
I use HMG311 and minigui extended (2.1.9) with same results. "Control: xxx Of Winxxx Not defined. Program terminated,
Can You help me?
THX Dodogo
Re: definition controls problem in windows
sorry wrong extension in picture file..
- danielmaximiliano
- Posts: 2612
- Joined: Fri Apr 09, 2010 4:53 pm
- Location: Argentina
- Contact:
Re: definition controls problem in windows
you better post an example?dodogo wrote: sorry wrong extension in picture file..
or just use GetProperty( Window, Control , value )
Ej :
Code: Select all
SendEmail.Text_1.Value := GetProperty( 'Incomming' , 'cUser' , 'value' )
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*
Saludos / Regards
DaNiElMaXiMiLiAnO
Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*
Saludos / Regards
DaNiElMaXiMiLiAnO
Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: definition controls problem in windows
Hidodogo wrote:Hi men.
I have still same problem. After definition window and show it, I try manipulate with control (grid, label..) Look picture from example.
I use HMG311 and minigui extended (2.1.9) with same results. "Control: xxx Of Winxxx Not defined. Program terminated,
Your problem might be this :
Viva HMGHMG Doc wrote: DECLARE WINDOW <WindowName>
A window must be declared using this command, if you need to refer to it prior
its definition in code, or when you refer to it in a different .prg file from
the one it was defined using semi-oop syntax.
Viva INTERNATIONAL HMG
Re: definition controls problem in windows
Hi.
Here is same example.
Here is same example.
Code: Select all
#include "minigui.ch"
********************************************************************************
Function Main
********************************************************************************
nWidth := GetDesktopWidth() * 0.4
nHeight := GetDesktopHeight() * 0.4
WinMain(nWidth,nHeight)
Return Nil
********************************************************************************
Function WinMain(nWidth,nHeight)
********************************************************************************
DEFINE WINDOW winMain ;
AT 0,0 ;
WIDTH nWidth ;
HEIGHT nHeight ;
TITLE 'PackFlowEE ' ;
MAIN;
MDI;
FONT 'System' SIZE 12
DEFINE MAIN MENU
POPUP 'File'
ITEM 'Open' ACTION WinStockFlow2()
ITEM 'Exit' ACTION winMain.Release
END POPUP
END MENU
END WINDOW
CENTER WINDOW winMain
ACTIVATE WINDOW winMain
RETURN Nil
********************************************************************************
FUNCTION WinStockFlow2()
********************************************************************************
define window WinStockFlow at 0,0 width 200 height 200 title 'WinStockFlow' MDICHILD ;
font 'ms sans serif' size 8 ;
DEFINE LABEL lblTest
ROW 40
COL 50
WIDTH 120
HEIGHT 20
VALUE "Test:"
FONTNAME "Arial"
FONTSIZE 10
FONTBOLD .T.
END LABEL
DEFINE BUTTON btnTest
ROW 60
COL 50
WIDTH 100
HEIGHT 28
ACTION test()
CAPTION "Test"
FONTNAME "Arial"
FONTSIZE 10
FLAT .F.
TABSTOP .T.
VISIBLE .T.
END BUTTON
end window
* WinStockFlow.center
* activate window WinStockFlow
return Nil
********************************************************************************
function test()
********************************************************************************
msgstop(WinStockFlow.lblTest.value)
return Nil
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: definition controls problem in windows
Hi dodogo
Problem points commented by "//" and test statements de-commented.
PS : HMG official doesn't support MDI windows .
Happy HMG'ing
Here fixed (and working) version of your program.dodogo wrote:Here is same example.
Problem points commented by "//" and test statements de-commented.
Code: Select all
#include "minigui.ch"
********************************************************************************
Function Main
********************************************************************************
nWidth := GetDesktopWidth() * 0.4
nHeight := GetDesktopHeight() * 0.4
WinMain(nWidth,nHeight)
Return Nil
********************************************************************************
Function WinMain(nWidth,nHeight)
********************************************************************************
DEFINE WINDOW winMain ;
AT 0,0 ;
WIDTH nWidth ;
HEIGHT nHeight ;
TITLE 'PackFlowEE ' ;
MAIN; // MDI;
FONT 'System' SIZE 12
DEFINE MAIN MENU
POPUP 'File'
ITEM 'Open' ACTION WinStockFlow2()
ITEM 'Exit' ACTION winMain.Release
END POPUP
END MENU
END WINDOW
CENTER WINDOW winMain
ACTIVATE WINDOW winMain
RETURN Nil
********************************************************************************
FUNCTION WinStockFlow2()
********************************************************************************
define window WinStockFlow at 0,0 width 200 height 200 title 'WinStockFlow' ; // MDICHILD ;
font 'ms sans serif' size 8 // ;
DEFINE LABEL lblTest
ROW 40
COL 50
WIDTH 120
HEIGHT 20
VALUE "Test:"
FONTNAME "Arial"
FONTSIZE 10
FONTBOLD .T.
END LABEL
DEFINE BUTTON btnTest
ROW 60
COL 50
WIDTH 100
HEIGHT 28
ACTION test()
CAPTION "Test"
FONTNAME "Arial"
FONTSIZE 10
FLAT .F.
TABSTOP .T.
VISIBLE .T.
END BUTTON
end window
WinStockFlow.center
activate window WinStockFlow
return Nil
********************************************************************************
function test()
********************************************************************************
msgstop(WinStockFlow.lblTest.value)
return Nil
Happy HMG'ing
Viva INTERNATIONAL HMG
Re: definition controls problem in windows
but extended edition have MDI...
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: definition controls problem in windows
You may find the reality on MDI heredodogo wrote:but extended edition have MDI...
By the way, your problem was not related to MDI
Regards
Viva INTERNATIONAL HMG
Re: definition controls problem in windows
Yes it's true.dodogo wrote:but extended edition have MDI...
The problem is that MDI support is not very good documented.
Now regarding your problem,
Code: Select all
********************************************************************************
function test()
********************************************************************************
msgstop(WinStockFlow.lblTest.value)
return Nil
In other words, the '_DefineChildMDIWindow' creation routine adds "by design" an "_n" at the end of the name of child window, where "n" is an ascending integer which increments each time a child window is defined. Actually it corresponds to ActiveMDIChildIndex.
Keep this in mind when you utilize MDI's.
But, as already pointed out, MDI usage is tricky and not suggested. If you can, avoid it!
(BTW, since you're using minigui extended you might get better replies if you post you questions also in MiniGUI extended forum )
---
Pete