Board Logo
« placing dialog_modal windows »

Welcome Guest. Please Login or Register.
Nov 20th, 2017, 10:17pm


Conforums Terms of Service | Membership Rules | Home | Search | Recent Posts | Notification | Format Your Message | Installation FAQ

Please use the forums Search feature before asking.
Please post code using the code box described in Format Your Messages.
This will keep indentation, separate it better form the message and prevent gibberish.
If the code is too long for one post or additional files are needed, upload a ZIP archive to the Just BASIC Files Archive Site.

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 sticky  Author  Topic: placing dialog_modal windows  (Read 2775 times)
Stefan Pendl
Administrator
ImageImageImageImageImage


member is offline

Avatar

Let's talk JB ...


Homepage PM

Gender: Male
Posts: 3711
thumbup placing dialog_modal windows
« Thread started on: Dec 28th, 2005, 07:45am »

The placement of windows is based on screen coordinates, but dialog_modal windows act different.

The placement of them is based on the current window client area, thanks to Janet for pointing this out once more.
Therefore, they can not be used without a main window.

Here is a simple demo to show that.
Code:
    nomainwin

' the UpperLeft values are in screen coordinates
' for all not modal windows
    UpperLeftX = 100
    UpperLeftY = 100
    WindowWidth = 200
    WindowHeight = 200

    open "close me - main" for window as #m
    #m "trapclose [quit.m]"

' the UpperLeft values are in window coordinates
' for modal dialogs
    UpperLeftX = 50
    UpperLeftY = 30
    WindowWidth = 100
    WindowHeight = 100

    open "close me - modal dialog" for dialog_modal as #1
    #1 "trapclose [quit]"
    wait

[quit]
    close #1
    wait

[quit.m]
    close #m
    end
 
User IP Logged

Stefan - Homepage

Remember to read the forum rules board wink

Just BASIC 1.01, Windows 10 Professional x64, Intel Core i7-4710MQ 2.5GHz, 16GB RAM
Welopez
Board Moderator


member is offline

Avatar

Never let your beliefs get in the way of learning.


PM

Gender: Male
Posts: 4407
xx Re: placing dialog_modal windows
« Reply #1 on: Dec 28th, 2005, 4:35pm »

An excellent tip, as well as DEMO, Stefan. Thanks to you and Janet both!

Rock-on, JB Users! wink
User IP Logged

JB 1.01
Win7 64bit, 4 GB RAM, Pentium 6200@2.13 GHz (laptop)
WinXP, 1 GB RAM, Intel N270@1.6 GHz (netbook)
Gordon R
Member in Training
ImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 52
xx Re: placing dialog_modal windows
« Reply #2 on: Dec 29th, 2005, 10:04am »

Well I thought this issue was solved long ago.
Didn't we had to do something with STYLEBITS?

Anyway this demo is a very good work around.
Issue a WINDOW_POPUP with a smaller width and height then the MODAL and you're in bussiness.

Good job.

Gordon.

PS of course you MUST close #m together with #1.

Code:
    nomainwin

' the UpperLeft values are in screen coordinates
' for all not modal windows
    UpperLeftX = 100
    UpperLeftY = 100
    WindowWidth = 1
    WindowHeight = 1

    open "close me - main" for window_popup as #m
    #m "trapclose [quit.m]"

' the UpperLeft values are in window coordinates
' for modal dialogs
    UpperLeftX = 150
    UpperLeftY = 30
    WindowWidth = 400
    WindowHeight = 400

    open "close me - modal dialog" for dialog_modal as #1
    #1 "trapclose [quit]"
    wait

[quit]
    close #1
    close #m
    wait

[quit.m]
    close #m
    end

 
« Last Edit: Dec 29th, 2005, 10:13am by Gordon R » User IP Logged

Welopez
Board Moderator


member is offline

Avatar

Never let your beliefs get in the way of learning.


PM

Gender: Male
Posts: 4407
xx Re: placing dialog_modal windows
« Reply #3 on: Dec 29th, 2005, 10:16am »

STYLEBITS and WINDOW_POPUP are fine when using LB, however the JB users must find suitable workarounds. In many cases, a window opened as DIALOG_MODAL can do the trick, but it sometimes has an annoying habit of popping up in a position the coder doesn't want. Knowing where the DIALOG_MODAL window will open, with respect to the GUI, makes it much more user friendly. cheesy
User IP Logged

JB 1.01
Win7 64bit, 4 GB RAM, Pentium 6200@2.13 GHz (laptop)
WinXP, 1 GB RAM, Intel N270@1.6 GHz (netbook)
Janet Terra
Global Moderator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM

Gender: Female
Posts: 3061
xx Re: placing dialog_modal windows
« Reply #4 on: Dec 29th, 2005, 10:22am »

on Dec 29th, 2005, 10:04am, Gordon R wrote:
Well I thought this issue was solved long ago.
Didn't we had to do something with STYLEBITS?

Just BASIC doesn't support Stylebits and I'm pretty sure Stylebits can only be used to center a dialog window in the screen display. I don't think you can assign any other placement with stylebits.
Really clever way of positioning a Dialog_Modal when no main calling window is actually wanted. wink Thanks Gordon.
Janet
User IP Logged

Janet Visit me at BASIC Samplings
zoomkat
Senior Member
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 980
xx Re: placing dialog_modal windows
« Reply #5 on: Dec 29th, 2005, 11:47am »

Trying to run Gordon's code just basic halts at the below line of code.

Code:
    open "close me - main" for window_popup as #m

 

User IP Logged

Why I like my 2005 rio yellow Honda S2000 with the top down, and more!
Gordon R
Member in Training
ImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 52
xx Re: placing dialog_modal windows
« Reply #6 on: Dec 29th, 2005, 12:10pm »

on Dec 29th, 2005, 11:47am, zoomkat wrote:
Trying to run Gordon's code just basic halts at the below line of code.

Code:
    open "close me - main" for window_popup as #m

 



You got me.
I didn't try JB.
I standard use LB.

JB has NO POPUP windows.
Carl?

Gordon
User IP Logged

Stefan Pendl
Administrator
ImageImageImageImageImage


member is offline

Avatar

Let's talk JB ...


Homepage PM

Gender: Male
Posts: 3711
exclamation Re: placing dialog_modal windows
« Reply #7 on: Dec 29th, 2005, 12:38pm »

on Dec 29th, 2005, 12:10pm, Gordon R wrote:
JB has NO POPUP windows.
Carl?

Gordon,
that is one feature, that should lead users of JB to switch over to LB.

In the future, test JB code only in JB, not LB.

To confuse other users not owning LB is not so good.
User IP Logged

Stefan - Homepage

Remember to read the forum rules board wink

Just BASIC 1.01, Windows 10 Professional x64, Intel Core i7-4710MQ 2.5GHz, 16GB RAM
Stefan Pendl
Administrator
ImageImageImageImageImage


member is offline

Avatar

Let's talk JB ...


Homepage PM

Gender: Male
Posts: 3711
exclamation Re: placing dialog_modal windows
« Reply #8 on: Dec 29th, 2005, 12:42pm »

on Dec 29th, 2005, 10:04am, Gordon R wrote:
PS of course you MUST close #m together with #1.

Gordon,
when you do that, your program is still running in the background, because of the "Wait" command.
A dialog_modal window is used like a prompt, notice or confirm window.
It is used to force the user to follow the contents of it.
User IP Logged

Stefan - Homepage

Remember to read the forum rules board wink

Just BASIC 1.01, Windows 10 Professional x64, Intel Core i7-4710MQ 2.5GHz, 16GB RAM
Stefan Pendl
Administrator
ImageImageImageImageImage


member is offline

Avatar

Let's talk JB ...


Homepage PM

Gender: Male
Posts: 3711
question Re: placing dialog_modal windows
« Reply #9 on: Dec 29th, 2005, 1:00pm »

on Dec 29th, 2005, 10:22am, Janet Terra wrote:
Really clever way of positioning a Dialog_Modal when no main calling window is actually wanted.

Janet,
why would you like to have a modal window without a main window huh
User IP Logged

Stefan - Homepage

Remember to read the forum rules board wink

Just BASIC 1.01, Windows 10 Professional x64, Intel Core i7-4710MQ 2.5GHz, 16GB RAM
Gordon R
Member in Training
ImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 52
xx Re: placing dialog_modal windows
« Reply #10 on: Dec 29th, 2005, 3:11pm »


Okay Stefan,

In the future I will test every JB listing with JB only.

Hello JB users,
I confused you. Sorry about that.
Please have a look at LB. There are many features you are missing.

Gordon
User IP Logged

Whitespaces
Full Member
ImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 193
xx Re: placing dialog_modal windows
« Reply #11 on: Dec 29th, 2005, 3:23pm »

Us jb yers are not confused. Were just alergic to DLL's.
User IP Logged

k7uk8u
Junior Member
ImageImageImage


member is offline

Avatar




PM


Posts: 75
xx Re: placing dialog_modal windows
« Reply #12 on: Sep 1st, 2007, 6:21pm »

I once got around this problem by having a variable to store whether or not the handle on a normal dialog box was open. This was because i was using them to stop the program trying to terminate without closing all the handles, so i tryed to use a dialog box to get around this. it worked in the end, but it was a lot harder than having a regular dialog_modal. I wis i had known about this earlier. Ah well, ya live and learn smiley
« Last Edit: Sep 1st, 2007, 6:22pm by k7uk8u » User IP Logged

WyTheGuy
Full Member
ImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 199
xx Re: placing dialog_modal windows
« Reply #13 on: Nov 4th, 2008, 11:53pm »

on Dec 29th, 2005, 3:23pm, Whitespaces wrote:
Us jb yers are not confused. Were just alergic to DLL's.


Amen to that. I have been putting off learning DLL's in LB..... I guess I'm gonna need to take a crack at it soon.... Guess I just don't have enough time on my hands right now sad
User IP Logged

-->#9Wylie<-- Dangerous Power G3 / Invert Nightstick / 68/4500 Crossfire / Dye Rotor smiley
Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

Conforums Terms of Service | Membership Rules | Home | Search | Recent Posts | Notification | Format Your Message | Installation FAQ

Donate $6.99 for 50,000 Ad-Free Pageviews!

| |

This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls