FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour 8 x DIALOG
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
8 x DIALOG
Posted: 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 (fw): Select all Collapse
DEFINE WINDOW oWnd
 ...
ACTIVATE WINDOW oWnd

now i like to have 8 x DIALOG ... but i like to create them in a Loop

Code (fw): Select all Collapse
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 (fw): Select all Collapse
   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
greeting,

Jimmy
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: 8 x DIALOG
Posted: Mon Dec 16, 2019 07: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 March-April 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
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: 8 x DIALOG
Posted: Mon Dec 16, 2019 01:37 PM
Try

Code (fw): Select all Collapse
ACTIVATE DIALOG &cForm NOMODAL


EMG
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: 8 x DIALOG
Posted: Mon Dec 16, 2019 06:49 PM
Enrico Maria Giordano wrote:
Code (fw): Select all Collapse
ACTIVATE DIALOG &cForm NOMODAL


YES, that seems to work, THX
greeting,

Jimmy
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: 8 x DIALOG
Posted: Mon Dec 16, 2019 06: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() :-)

is it the same like DEFINE DIALOG :-)
greeting,

Jimmy
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: 8 x DIALOG
Posted: Mon Dec 16, 2019 09:16 PM
next Question

Code (fw): Select all Collapse
   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
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: 8 x DIALOG
Posted: Tue Dec 17, 2019 12:29 AM
next try

Code (fw): Select all Collapse
   oForm  := TDialog():New()

without any Parameter i got 8 x Dialog :-)

Code (fw): Select all Collapse
   oForm  := TDialog():New( nTop, nLeft, nBottom, nRight)

if i try nTop, nLeft, nBottom, nRight nothing appear :-)

Code (fw): Select all Collapse
   oForm  := TDialog():New( nTop, nLeft, nBottom, nRight,;
                               ,,,,,,,, lPixels,,)

if i try it with lPixels it crash :-)
greeting,

Jimmy
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: 8 x DIALOG
Posted: Tue Dec 17, 2019 10:51 PM
now with OOP

as CLASS TDialog inherit FROM TWindow i use
Code (fw): Select all Collapse
   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
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: 8 x DIALOG
Posted: Tue Dec 17, 2019 10:56 PM
Try with the clause

Code (fw): Select all Collapse
STYLE WS_POPUP


EMG
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: 8 x DIALOG
Posted: Tue Dec 17, 2019 11:30 PM
hi,
Enrico Maria Giordano wrote:Try with the clause
Code (fw): Select all Collapse
STYLE WS_POPUP

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 (fw): Select all Collapse
   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
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: 8 x DIALOG
Posted: Thu Dec 19, 2019 02: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
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: 8 x DIALOG
Posted: Thu Dec 19, 2019 08:35 AM
Code (fw): Select all Collapse
ON INIT oDlg:bValid := { || !GetKeyState( VK_ESCAPE ) }


EMG
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: 8 x DIALOG
Posted: Fri Dec 20, 2019 02:22 AM
hi,
Enrico Maria Giordano wrote:
Code (fw): Select all Collapse
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

Continue the discussion