IonicWind Software

Creative Basic => General Questions => Topic started by: Ziad Diab Electronics on May 18, 2017, 12:38:31 pm

Title: Edit control in child window
Post by: Ziad Diab Electronics on May 18, 2017, 12:38:31 pm
Hello ...

How can the user write in the Edit Control (Text Field) in a child window ?
It is like the child window is disabled ...

Code Select

' Multiple windows - GWS

def win,win_cont,win_draw:window
def dlg_cont,dlg_draw:dialog
def i,j,nwin,wW,wH:int
def nhoriz,nvert,winwid,winhgt:int
def st:string

GetScreenSize wW,wH

' open main window ..
window win,0,0,wW,wH,0,0,"Creative Basic - Windows Extravaganza",messages
setwindowcolor win,rgb(0,0,50)

control win,"B,Exit,(wW-70)/2,0.87*wH,70,30,0,1"

nhoriz = 9: nvert = 5
winwid = wW/nhoriz
winhgt = wH/(nvert*1.2)

'Control dialog ==================================================
window win_cont,50,50,300,500,0,win,"Draw",hnd_cont
'DIALOG dlg_cont,0,0,221,156,0x80C80080,win,"Shape control",hnd_cont
CONTROL win_cont,"B,Add Shape,75,125,70,20,0x50000000,1"
CONTROL win_cont,"E,"hello",121,35,70,20,0x50800000,2"
CONTROL win_cont,"E,Edit2,121,60,70,20,0x50800000,3"
CONTROL win_cont,"E,Edit3,121,85,70,20,0x50800000,4"
CONTROL win_cont,"T,Number of Turnes,21,35,94,20,0x5000010B,6"
CONTROL win_cont,"T,Conductor width,21,60,86,20,0x5000010B,7"
CONTROL win_cont,"T,Spacing,21,85,70,20,0x5000010B,8"
CONTROL win_cont,"C,Group,13,13,192,104,0x50000007,9"
'SETFONT win_cont,"Arial",10,100,0,2
'ENABLETABS win_cont, 1

'SHOWDIALOG dlg_cont
'SHOWDILOG shows the "dialog" without disableing the main window unlike DOMODAL
'But dialog still above main window

window win_draw,50,50,100,100,0,win,"Draw",winmessages

run = 1

waituntil run = 0
closewindow win

sub hnd_cont
select @CLASS
case 1
setcontroltext win_cont,2,"Hello"
'st = getcontroltext(win_cont,4)
'closedialog win_cont,@IDOK
move win_cont,100,400
print win_cont,"wow"
case 2
case 3
case 4
case 5

Sub messages
select @class
case @idclosewindow
run = 0
case @idcontrol
if @controlID = 1 then run = 0

Sub winmessages
select @class
case @idclosewindow
closewindow @hitwindow
case @idcontrol
if @controlID = 1 then run = 0

Ziad Diab Electronics
Thank you
Title: Re: Edit control in child window
Post by: ckoehn on May 19, 2017, 06:18:21 am
This is from the help file.
QuoteMDI windows

Multiple Document Interface, or MDI, windows consist of a parent frame window and one or more child windows. Most word processors use the MDI interface as well as Creative BASIC’s editor. To create a MDI interface first open a window with @MDIFRAME as one of the creations flags:

WINDOW frame,0,0,640,400,@MDIFRAME|@SIZE,0,”Main”,main

Any child windows would use that window as the parent parameter:

WINDOW w,0,0,200,100,@SIZE|@MINBOX|@MAXBOX,frame,”Child”,main

The help file is usually your friend.


Title: Re: Edit control in child window
Post by: Ziad Diab Electronics on May 19, 2017, 06:44:56 am
Thank you that's working ...

Ziad Diab Electronics