Just starting out? Need help? Post your questions and find answers here.
Michael E
 
Posts: 1
Joined: Mon Apr 04, 2016 9:18 am

Normal Webpage not MDI How?

by Michael E Mon Apr 04, 2016 9:25 am

Hello,

I am looking to make a web app, but I need it to look like a normal webpage, not a MDI/ window inside of a window.

This forum is on a webpage and it has features and buttons, and actions etc... without document floating around on a different background...

What commands or user guides can I review..... I have Purevision, and I exported a previous PB project from it to SpiderBasic, and the output automatically put my user interface as a MDI document on top of a blue background.

Thanks for you Help
MIke
User avatar
SparrowhawkMMU
 
Posts: 267
Joined: Wed Aug 19, 2015 3:02 pm
Location: United Kingdom

Re: Normal Webpage not MDI How?

by SparrowhawkMMU Mon Apr 04, 2016 10:25 am

I think you do this by including the #PB_Window_Background flag when calling OpenWindow()
User avatar
skywalk
 
Posts: 35
Joined: Tue Feb 25, 2014 2:13 am
Location: Boston, MA

Re: Normal Webpage not MDI How?

by skywalk Mon Apr 04, 2016 6:15 pm

Thanks, I had the same question.
When working toward the solution of a problem, it always helps if you know the answer. ~ ?
An expert is one who knows more and more about less and less until he knows absolutely everything about nothing. ~ Weber
DanLJr
 
Posts: 43
Joined: Wed Jul 04, 2018 4:24 am

Re: Normal Webpage not MDI How?

by DanLJr Thu Jul 05, 2018 10:48 pm

Hi All!

Trying-out SB for the first time. Attempting to test this concept (of no windows; just a flat webpage) with a simple Hello World! program. (I'm brand new to SB, but an old-school QuickBASIC and VB developer from decades ago, so I'm not new to programming overall.)

Ok, on to the business at hand...

I'm not getting expected results from OpenWindow as a webpage background.

It does NOT seem to make the window the background of the webpage, even though I specified #PB_Window_Background. I can still see the titlebar and grab/move the window, etc. What am I not understanding here? (Hopefully, I'm just being dumb/noob, and this is a simple misunderstanding on my part.)

Here's my very simple code for testing:

Code: Select all
HiWrld$ = "Hello World!"

If OpenWindow(#PB_Any, #PB_Ignore, #PB_Ignore, 600, 600, "Window Is Supposed To Be Background. Why Is It Not?", #PB_Ignore, #PB_Window_Background)
  TextGadget(#PB_Any, (WindowHeight(GetActiveWindow())-300)/2, (WindowWidth(GetActiveWindow())-300)/2, 300, 300, HiWrld$, #PB_Text_Center + #PB_Text_VerticalCenter)
EndIf


Any clarity/help/corrections/explanations/samples would be greatly appreciated.

Thanks in advance!
-Dan
User avatar
Peter
 
Posts: 553
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1

Re: Normal Webpage not MDI How?

by Peter Fri Jul 06, 2018 7:00 am

DanLJr wrote:
Code: Select all
If OpenWindow(#PB_Any, #PB_Ignore, #PB_Ignore, 600, 600, "Window Is Supposed To Be Background. Why Is It Not?", #PB_Ignore, #PB_Window_Background)

Code: Select all
If OpenWindow(#PB_Any, #PB_Ignore, #PB_Ignore, 600, 600, "Window Is Supposed To Be Background. Why Is It Not?", #PB_Window_Background)


Greetings ... Peter
DanLJr
 
Posts: 43
Joined: Wed Jul 04, 2018 4:24 am

Re: Normal Webpage not MDI How?

by DanLJr Fri Jul 06, 2018 1:25 pm

Peter wrote:
DanLJr wrote:
Code: Select all
If OpenWindow(#PB_Any, #PB_Ignore, #PB_Ignore, 600, 600, "Window Is Supposed To Be Background. Why Is It Not?", #PB_Ignore, #PB_Window_Background)

Code: Select all
If OpenWindow(#PB_Any, #PB_Ignore, #PB_Ignore, 600, 600, "Window Is Supposed To Be Background. Why Is It Not?", #PB_Window_Background)


Greetings ... Peter


Thanks, Peter, but now I'm really confused. Is the documentation wrong? There is supposed to be a WindowID argument passed between Title$ and Flags, according to the SB help file! Here is a copy/paste of the help documentation that I'm following:

#Window A number to identify the new window. #PB_Any can be used to auto-generate this number.
x, y The initial position of the window, in pixels (unless one of the center flags is used). If 'x' or 'y' is set to #PB_Ignore, the OS will choose a position for the window.
InnerWidth, InnerHeight The required client area, in pixels (without borders and window decorations).
Title$ The title of the newly created window.
ParentWindowID (optional) The WindowID the new window belongs to. 'ParentWindowID' value can be easily obtained with WindowID().
Flags (optional) Can be a combination of the following values:
#PB_Window_SystemMenu : Enables the system menu on the window title bar (default).
#PB_Window_Background : The window doesn't have a frame and is put in the web browser background. It can only have one window
with the background flag opened at the same time. This window will be automatically resized when the
web browser is resized.
#PB_Window_SizeGadget : Adds the sizeable feature to a window.
#PB_Window_Invisible : Creates the window but don't display.
#PB_Window_TitleBar : Creates a window with a titlebar.
#PB_Window_BorderLess : Creates a window without any borders.
#PB_Window_ScreenCentered: Centers the window in the middle of the screen. x,y parameters are ignored.
#PB_Window_WindowCentered: Centers the window in the middle of the parent window ('ParentWindowID' must be specified).
x,y parameters are ignored.
#PB_Window_NoActivate : Don't activate the window after opening.
Return value

Nonzero if the window was successfully created, zero otherwise. If #PB_Any was used for the #Window parameter then the generated number is returned on success.

-------------

I think I found it... Note that the top it shows:

Syntax

Result = OpenWindow(#Window, x, y, InnerWidth, InnerHeight, Title$ [, Flags [, ParentWindowID]])
Description
Opens a new window according to the specified parameters. The new window becomes the active window, it's not needed to use SetActiveWindow() (unless the window is created as invisible).

-------------

Now I see it! Looks like the ParentWindowID is the LAST argument, however in the detailed description (copied/pasted above), below the syntax section in help, it appears that WindowID is BEFORE the Flags... re-reading the Syntax descriptor at the top it is not... but that's VERY confusing and the documentation/help should be corrected so that it is in consistent order in both places. (I looked at it like 20 times and never saw the difference until comparing with your corrected code. Why are the descriptions out of order from the syntax itself?)

Anyhow, thanks Peter, and on to the next experiment/challenge!!!
User avatar
Peter
 
Posts: 553
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1

Re: Normal Webpage not MDI How?

by Peter Fri Jul 06, 2018 2:58 pm

yes, you're right.

The Syntax-Description is correct.

The Parameters-Description is in the wrong order.

https://www.spiderbasic.com/documentation/window/openwindow.html

Greetings ... Peter
DanLJr
 
Posts: 43
Joined: Wed Jul 04, 2018 4:24 am

Re: Normal Webpage not MDI How?

by DanLJr Fri Jul 06, 2018 7:52 pm

Peter wrote:yes, you're right.

The Syntax-Description is correct.

The Parameters-Description is in the wrong order.

https://www.spiderbasic.com/documentation/window/openwindow.html

Greetings ... Peter


Thanks Peter! At least now I know I'm not crazy. :D

I'll just confirm with the 'syntax area' in the docs from now on and not trust the order of the detailed documentation. No biggie.

(I did find what I THINK is a bug??? Other thread: viewtopic.php?f=11&t=1527 , if interested in taking a look...)
Return to Coding Questions

Who is online

Users browsing this forum: No registered users and 2 guests