Inputbox
Posted: Fri Jun 15, 2012 9:48 am
Why does inputbox not work without MAIN WINDOW??
(Messageinfo and msgyesno do)
Richard
(Messageinfo and msgyesno do)
Richard
Exclusive forum for HMG, a Free / Open Source xBase WIN32/64 Bits / GUI Development System
http://www.hmgforum.com/
Hit57042 wrote:Why does inputbox not work without MAIN WINDOW??
(Messageinfo and msgyesno do)
Richard
Richard :t57042 wrote:Why does inputbox not work without MAIN WINDOW??
(Messageinfo and msgyesno do)
Richard
Nice one, Daniel !danielmaximiliano wrote:Use Inputbox from WinAPI: http://www.codeproject.com/Articles/242 ... ing-WinAPI
+1danielmaximiliano wrote:Richard :t57042 wrote:Why does inputbox not work without MAIN WINDOW??
(Messageinfo and msgyesno do)
Richard
what is your need for Inputbox before creating the main window?
Use Inputbox from WinAPI : http://www.codeproject.com/Articles/242 ... ing-WinAPI
Code: Select all
#include "hmg.ch"
Function main()
DEFINE WINDOW Form_1 ;
AT 0,0 ;
WIDTH 1 ; //640,480
HEIGHT 1 ;
TITLE 'InputBox Demo' ;
MAIN ;
ON INIT (MsgInfo("Hola"),Form_1.WIDTH := 640, Form_1.HEIGHT:=480)
@ 50 ,100 BUTTON Button_1 ;
CAPTION "InputBox Test" ;
ACTION CLick() ;
WIDTH 200 ;
HEIGHT 30
@ 100 ,100 BUTTON Button_2 ;
CAPTION "InputBox (Timeout) Test" ;
ACTION TCLick() ;
WIDTH 200 ;
HEIGHT 30
@ 150 ,100 BUTTON Button_3 ;
CAPTION "InputBox (Timeout) Test 2" ;
ACTION TCLick2() ;
WIDTH 200 ;
HEIGHT 30
END WINDOW
ACTIVATE WINDOW Form_1
Return
Procedure Click
MsgInfo ( InputBox ( 'Enter text' , 'InputBox Demo' , 'Default Value' ) )
Return
Procedure TClick
MsgInfo ( InputBox ( 'Enter text' , 'InputBox Demo' , 'Default Value' , 5000 ) )
Return
Procedure TClick2
MsgInfo ( InputBox ( 'Enter text' , 'InputBox Demo' , 'Default Value' , 5000 , 'Timeout Value' ) )
Return
Code: Select all
Function Main()
SET WINDOW MAIN OFF
InputBox()
_HMG_SYSDATA [ 271 ] := .F. // _HMG_IsModalActive, InputBox() is a modal Window
SET WINDOW MAIN ON
...
Return
Code: Select all
#include <hmg.ch>
Function Main()
Local cTest:=""
SET WINDOW MAIN OFF
cTest := InputBox ( "Type your name: ", "HMG InputBox Demo without Main Form", cTest )
_HMG_SYSDATA [ 271 ] := .F. // _HMG_IsModalActive, InputBox() is a modal Window
SET WINDOW MAIN ON
MsgInfo(cTest)
Return Nil
Thank you Javier for your example.Javier Tovar wrote:You can also simulate InputBox start with, if you do a trick, you do give very small MAIN window
Nicesrvet_claudio wrote:See this code:
Code: Select all
Function Main() SET WINDOW MAIN OFF InputBox() _HMG_SYSDATA [ 271 ] := .F. // _HMG_IsModalActive, InputBox() is a modal Window SET WINDOW MAIN ON ... Return