8 x DIALOG

Post Reply
User avatar
Jimmy
Posts: 165
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

8 x DIALOG

Post 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 :idea:

please help a FiveWin Newbie, thx
greeting,
Jimmy
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: 8 x DIALOG

Post by Silvio.Falconi »

it's not my business, but why do you want to create 8 dialogs, what's the use?
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
Jimmy
Posts: 165
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: 8 x DIALOG

Post by Jimmy »

Enrico Maria Giordano wrote:

Code: Select all

ACTIVATE DIALOG &cForm NOMODAL
YES, that seems to work, THX
greeting,
Jimmy
User avatar
Jimmy
Posts: 165
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: 8 x DIALOG

Post 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() :idea:

is it the same like DEFINE DIALOG :?:
greeting,
Jimmy
User avatar
Jimmy
Posts: 165
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: 8 x DIALOG

Post 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
greeting,
Jimmy
User avatar
Jimmy
Posts: 165
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: 8 x DIALOG

Post by Jimmy »

next try

Code: Select all

   oForm  := TDialog():New()
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 :cry:

Code: Select all

   oForm  := TDialog():New( nTop, nLeft, nBottom, nRight,;
                               ,,,,,,,, lPixels,,)
if i try it with lPixels it crash :oops:
greeting,
Jimmy
User avatar
Jimmy
Posts: 165
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: 8 x DIALOG

Post 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 :?:
greeting,
Jimmy
User avatar
Jimmy
Posts: 165
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: 8 x DIALOG

Post by Jimmy »

hi,
Enrico Maria Giordano wrote:Try with the clause

Code: Select all

STYLE WS_POPUP
EMG
thx for Answer.

i have Problem when have any parameter at "create" than no Dialog appear :o
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)
greeting,
Jimmy
User avatar
Jimmy
Posts: 165
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: 8 x DIALOG

Post 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.
greeting,
Jimmy
User avatar
Jimmy
Posts: 165
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: 8 x DIALOG

Post 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
greeting,
Jimmy
Post Reply