8 x DIALOG

8 x DIALOG

Postby Jimmy » Mon Dec 16, 2019 12:43 am

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  Expand view  RUN
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  Expand view  RUN
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  Expand view  RUN
  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
Jimmy
 
Posts: 1733
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: 8 x DIALOG

Postby Silvio.Falconi » Mon Dec 16, 2019 7:52 am

it's not my business, but why do you want to create 8 dialogs, what's the use?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7074
Joined: Thu Oct 18, 2012 7:17 pm

Re: 8 x DIALOG

Postby Enrico Maria Giordano » Mon Dec 16, 2019 1:37 pm

Try

Code: Select all  Expand view  RUN
ACTIVATE DIALOG &cForm NOMODAL


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8719
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: 8 x DIALOG

Postby Jimmy » Mon Dec 16, 2019 6:49 pm

Enrico Maria Giordano wrote:
Code: Select all  Expand view  RUN
ACTIVATE DIALOG &cForm NOMODAL


YES, that seems to work, THX
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1733
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: 8 x DIALOG

Postby Jimmy » Mon Dec 16, 2019 6:56 pm

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: 1733
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: 8 x DIALOG

Postby Jimmy » Mon Dec 16, 2019 9:16 pm

next Question

Code: Select all  Expand view  RUN
   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: 1733
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: 8 x DIALOG

Postby Jimmy » Tue Dec 17, 2019 12:29 am

next try

Code: Select all  Expand view  RUN
  oForm  := TDialog():New()

without any Parameter i got 8 x Dialog :(

Code: Select all  Expand view  RUN
  oForm  := TDialog():New( nTop, nLeft, nBottom, nRight)

if i try nTop, nLeft, nBottom, nRight nothing appear :cry:

Code: Select all  Expand view  RUN
  oForm  := TDialog():New( nTop, nLeft, nBottom, nRight,;
                               ,,,,,,,, lPixels,,)

if i try it with lPixels it crash :oops:
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1733
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: 8 x DIALOG

Postby Jimmy » Tue Dec 17, 2019 10:51 pm

now with OOP

as CLASS TDialog inherit FROM TWindow i use
Code: Select all  Expand view  RUN

   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: 1733
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: 8 x DIALOG

Postby Enrico Maria Giordano » Tue Dec 17, 2019 10:56 pm

Try with the clause

Code: Select all  Expand view  RUN
STYLE WS_POPUP


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8719
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: 8 x DIALOG

Postby Jimmy » Tue Dec 17, 2019 11:30 pm

hi,
Enrico Maria Giordano wrote:Try with the clause
Code: Select all  Expand view  RUN
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  Expand view  RUN
  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: 1733
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: 8 x DIALOG

Postby Jimmy » Thu Dec 19, 2019 2:51 am

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: 1733
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: 8 x DIALOG

Postby Enrico Maria Giordano » Thu Dec 19, 2019 8:35 am

Code: Select all  Expand view  RUN
ON INIT oDlg:bValid := { || !GetKeyState( VK_ESCAPE ) }


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8719
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: 8 x DIALOG

Postby Jimmy » Fri Dec 20, 2019 2:22 am

hi,
Enrico Maria Giordano wrote:
Code: Select all  Expand view  RUN
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/viewtopic.php?f=3&t=38228

thx all for help
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1733
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 57 guests