Page 1 of 1
8 x DIALOG
Posted: Mon Dec 16, 2019 12:43 am
by Jimmy
hi,
i have a working Xbase++ Version and a HMG Version and now i want to make a FiveWin Version.
FiveWin have this Syntax
Code: Select all
DEFINE WINDOW oWnd
...
ACTIVATE WINDOW oWnd
now i like to have 8 x DIALOG ... but i like to create them in a Loop
Code: Select all
FUNCTION CreateForms()
Local i,iMax := 8
Local cForm
FOR i = 1 TO iMax
cForm := "Form_"+strzero(i, 2)
DEFINE DIALOG &cForm FROM nTop, nLeft TO nBottom, nRight
// add Object to Array
AADD(a_Forms, &cForm)
NEXT
RETURN NIL
Problem : i do NOT want to ACTIVATE WINDOW, just show it
i did this
Code: Select all
FOR i := 1 TO iMax
cForm := a_Forms[i]
ACTIVATE DIALOG &cForm
NEXT
but only 1 DIALOG appear until i close it and next appear
so how to get a Concept like this working under FiveWin
please help a FiveWin Newbie, thx
Re: 8 x DIALOG
Posted: Mon Dec 16, 2019 7:52 am
by Silvio.Falconi
it's not my business, but why do you want to create 8 dialogs, what's the use?
Re: 8 x DIALOG
Posted: Mon Dec 16, 2019 1:37 pm
by Enrico Maria Giordano
Re: 8 x DIALOG
Posted: Mon Dec 16, 2019 6:49 pm
by Jimmy
Enrico Maria Giordano wrote:
YES, that seems to work, THX
Re: 8 x DIALOG
Posted: Mon Dec 16, 2019 6:56 pm
by Jimmy
hi,
Silvio.Falconi wrote:it's not my business, but why do you want to create 8 dialogs, what's the use?
i just try out how FiveWin Syntax work.
i'm used to OOP Code where it is no Problem to get 8 Instanze
now with #xCommand Syntax i have to use Macro ... it is like Cl*pper
Question : What about TDialog()
is it the same like DEFINE DIALOG
![Question :?:](./images/smilies/icon_question.gif)
Re: 8 x DIALOG
Posted: Mon Dec 16, 2019 9:16 pm
by Jimmy
next Question
Code: Select all
FOR i = 1 TO iMax
cForm := "Form_"+strzero(i, 2)
DEFINE DIALOG &cForm ;
FROM nTop, nLeft TO nRight, nBottom
ACTIVATE DIALOG &cForm NOMODAL
if i add FROM i got "Main" DIALOG only so what i'm doing wrong
p.s. nTop, nLeft, nRight, nBottom have valid Value
Re: 8 x DIALOG
Posted: Tue Dec 17, 2019 12:29 am
by Jimmy
next try
without any Parameter i got 8 x Dialog
Code: Select all
oForm := TDialog():New( nTop, nLeft, nBottom, nRight)
if i try nTop, nLeft, nBottom, nRight nothing appear
Code: Select all
oForm := TDialog():New( nTop, nLeft, nBottom, nRight,;
,,,,,,,, lPixels,,)
if i try it with lPixels it crash
![Embarassed :oops:](./images/smilies/icon_redface.gif)
Re: 8 x DIALOG
Posted: Tue Dec 17, 2019 10:51 pm
by Jimmy
now with OOP
as CLASS TDialog inherit FROM TWindow i use
Code: Select all
oForm := TDialog():New()
oForm:Activate( ,,,,, lModal,,)
// Superclass Method
oForm:SetSize(nRight,nBottom,.T.)
oForm:SetPos( nTop, nLeft )
now i got my 8 x Dialog
but i have more Question :
how to disable Titlebar with min/max/close button
![Question :?:](./images/smilies/icon_question.gif)
Re: 8 x DIALOG
Posted: Tue Dec 17, 2019 10:56 pm
by Enrico Maria Giordano
Re: 8 x DIALOG
Posted: Tue Dec 17, 2019 11:30 pm
by Jimmy
hi,
Enrico Maria Giordano wrote:Try with the clause
EMG
thx for Answer.
i have Problem when have any parameter at "create" than no Dialog appear
perhaps while i have a Main Dialog with SIZE 0,0 before create those 8 x DIALOG
that's why i change to OOP Style.
in c:\fwh\source\classes\DIALOG.PRG i found DATA nStyle so i change it with you advice
Code: Select all
FOR i = 1 TO iMax
oForm := TDialog():New()
// before activate
oForm:nStyle := WS_POPUP
oForm:Activate( ,,,,, lModal,,)
// after activate
oForm:SetPos( nTop, nLeft )
oForm:SetSize(nRight,nBottom,.T.)
AADD(a_Forms, oForm)
nLeft += nRight + 2
NEXT
now i got my 8 x Dialog an can begin to "paint" (ON PAINT)
Re: 8 x DIALOG
Posted: Thu Dec 19, 2019 2:51 am
by Jimmy
hi.
now i have TrayIcon for Main and a new Question : how can i "disable close" by Keyboard ESC
those 8 x Dialog don't need to "react" on something only "ON PAINT".
i want to "close" all Dialog from TrayIcon-Menu.
Re: 8 x DIALOG
Posted: Thu Dec 19, 2019 8:35 am
by Enrico Maria Giordano
Code: Select all
ON INIT oDlg:bValid := { || !GetKeyState( VK_ESCAPE ) }
EMG
Re: 8 x DIALOG
Posted: Fri Dec 20, 2019 2:22 am
by Jimmy
hi,
Enrico Maria Giordano wrote:Code: Select all
ON INIT oDlg:bValid := { || !GetKeyState( VK_ESCAPE ) }
THX, that was the missing Part.
now i got Sample working right ... but i have used my "old" Code with DllCall()
i can't simple replace it with FiveWin CreateRectRgn() / CombineRgn() while "something" is different so Result is different.
if you like more Detail please read this Thread
http://forums.fivetechsupport.com/viewt ... =3&t=38228
thx all for help