Center a region in the browser

I've been using IntraWeb for years, and the way I would get a small region to center itself in the browser is to simply uncheck the Anchors check boxes.  Most browsers,  most of the time, would simply center the region.  Of course, nothing is that simple.  Certain versions (even modern ones) of the big name browsers don't do this properly.   I'm using Delphi XE3 and IW 12x.   I can find an example on the AtoZed website of the alignment capabilities of IntraWeb...shown in a video, but not code nor property
 settings are shown.  Not much help.

What is the proper, reliable way to force a small region to center itself in the browser using my stated platform and versions?  (Is there a single property somewhere on the Region that is named "Display me in the center of the browser"?
0
Kevin
3/25/2013 8:18:56 PM
embarcadero.delphi.intraweb 3901 articles. 1 followers. Follow

8 Replies
1785 Views

Similar Articles

[PageSpeed] 42

On 3/25/2013 4:18 PM, Kevin Morris wrote:
> I've been using IntraWeb for years, and the way I would get a small region to center itself in the browser is to simply uncheck the Anchors check boxes.  Most browsers,  most of the time, would simply center the region.  Of course, nothing is that simple.  Certain versions (even modern ones) of the big name browsers don't do this properly.   I'm using Delphi XE3 and IW 12x.   I can find an example on the AtoZed website of the alignment capabilities of IntraWeb...shown in a video, but not code nor proper
ty
>   settings are shown.  Not much help.
>
> What is the proper, reliable way to force a small region to center itself in the browser using my stated platform and versions?  (Is there a single property somewhere on the Region that is named "Display me in the center of the browser"?

When you run the Guess demo, is it centered as you seek?


-- 
"Programming is an art form that fights back"
IntraWeb IRC and Web Chat:
http://www.atozed.com/intraweb/Support/IRC.aspx
0
Chad
3/25/2013 10:01:53 PM
> When you run the Guess demo, is it centered as you seek?

Yes.  I see that the anchors are all switched off.  (False) Is there any other setting I need to pay attention to?
0
Kevin
3/25/2013 10:15:09 PM
Kevin Morris wrote:

> > When you run the Guess demo, is it centered as you seek?
> 
> Yes.  I see that the anchors are all switched off.  (False) Is there
> any other setting I need to pay attention to?

Hi Kevin,

which specific IW version are you using? When you turn anchors off,
what happens then? Have you tried different browsers?
0
Alexandre
3/26/2013 10:33:26 AM
Hi Kevin,
heres some code that i do for each form where i put all my controls on 
'formregion' and center the 'formregion' if the browser width is wider 
than the region


     omyForm.width := webapplication.FormWidth;
     if webapplication.FormWidth < oRegion.width then
     begin
       oRegion.Anchors := [aktop, akleft];
       oRegion.left := 1;
     end
     else
     begin
       oRegion.Anchors := [aktop];
       oRegion.left := (omyForm.width - oRegion.width) div 2;
     end;



On 26/03/2013 12:33 PM, Alexandre Machado <Alexandre Machado wrote:
> Kevin Morris wrote:
>
>>> When you run the Guess demo, is it centered as you seek?
>>
>> Yes.  I see that the anchors are all switched off.  (False) Is there
>> any other setting I need to pay attention to?
>
> Hi Kevin,
>
> which specific IW version are you using? When you turn anchors off,
> what happens then? Have you tried different browsers?
>
0
sean
3/26/2013 12:14:43 PM
Hi Sean and Alex,

I guess the answer is "No" there is no single setting that takes care of centering, and I am correct just to uncheck the Align(ment) check boxes, and I can use Sean's code for browsers that don't behave.  Thanks to both.
0
Kevin
3/26/2013 1:38:43 PM
> {quote:title=Kevin Morris wrote:}{quote}
> Hi Sean and Alex,
> 
> I guess the answer is "No" there is no single setting that takes care of centering, and I am correct just to uncheck the Align(ment) check boxes, and I can use Sean's code for browsers that don't behave.  Thanks to both.

If you can use a single TIWRegion (name it Container for replace in html below) as a container and place all components on that then you can use a template to center the whole thing (you may need to have a css with text alignment)

If you use a TIWTemplateProcessorHTML or TIWLayoutMrgHTML and something like:

<!DOCTYPE html>
<html>
<title>your title</title>
<head>
<link rel="stylesheet" type="text/css" href="http://your.css">	
</head>
<body bgproperties="fixed" topmargin="0" leftmargin="0" bgcolor="#3176A8" sbgcolor="white" text="black" link="blue" vlink="purple" alink="red" style="font-size:8px;margin:0px;padding-bottom:0px;padding-left:0px;padding-right:0px;padding-top:0px;">


<div style="border:1px solid; border-color:#000000; width:1200px; margin:0 auto;">
<div id="container" style="background-color:#FFFFFF;width:1200px;">
{%Container%}
</div>
</div>


</body>
</html>

The whole region is then kept in that region, and when the browser window becomes too small behaves as expected.

Edited by: Ryszard Jurowski on Feb 5, 2014 5:11 AM
0
Ryszard
2/5/2014 1:12:16 PM
I used css to centering login region:
{code}.centered-panel {
  margin: 0 auto !important;
  position: relative !important;
}{code}
0
John
2/8/2014 9:52:55 PM
Look at the Guess demo. Just make a region and reset all the anchors.


-- 
"Programming is an art form that fights back"
IntraWeb IRC and Web Chat:
http://www.atozed.com/intraweb/Support/IRC.aspx
0
Chad
2/11/2014 6:32:49 PM
Reply:

Similar Artilces:

Center webpage in the center of the browser
I have created a master page and would like the content to display in the center of the browser vice left justified. The master page contains 3 separate tables stacked vertically.  Is there a way to get the master page center justified and for all the inheriting pages to do the same.  I am using a CSS file on all three tables which looks like this, but I have been unable to get the page centered.  I would like it to look something similar to http://www.msn.com/. position: absolute;top: 0;right: 0;bottom: 0;left: 0;width: 900px;height: auto;margin: auto;text-align: center;ver...

Change in browser-region/region.properties. How to deal with it?
I've just found (or better, Mozilla Translator just found) a change in en-US region.properties (removed gfns=1 from keyword.url) http://hg.mozilla.org/mozilla-central/rev/d5e211bdd793 Since every time I'll export my localization and commit my changes I'll risk to forget about this file (I have to manually uncheck it in TortoiseHg), what's the best (and fastest) way to deal with this change? A mass-change bug? An individual bug with approval request? Francesco On 13.08.10 21:41, flod wrote: > I've just found (or better, Mozilla Translator just foun...

Browser in Browser
Hi, I need to create a webpage which have a browser inside it.I know there is a WebBrowser control to be use for exe application, but is there one for web asp.net page?Done some research and found a website: gollum.easycp.deIt have the concept of what I want, but this only about to search on Wikipedia. I need to be able to surf inside that control.Any idea? Try http://www.codeproject.com/KB/aspnet/asproxy.aspx not sure if you mean something like this Gately: I need to create a webpage which have a browser inside it.I know there is a WebBrowser control to be use for exe appl...

[ANNOUNCE] removal of keyword.URL on l10n-central's browser-region/region.properties
Hi, as some of you might have seen keyword.URL on browser/chrome/browser-region/region.properties is no more. Here you have a rs=me on removing that entry from your versions of region.properties. This is only for l10n-central, and, once we have it, releases/l10n-mozilla-2.0. *Do Not* remove it one releases/l10n-mozilla-1.9.2 or earlier. HTH Axel ...

Intraweb 12.1.24 and TimeOutResponse demo from version Intraweb XI in delphi XE2 Update 3
Hello I'm very new in Intraweb and until now everything look fine. I'm looking for dev. tools for new application and I’m now testing IW XII. IW demo XI TimeOutResponse I don't understood very well. What should happen here. After 1 min of idle time after I push button in my browser I should get a Timeout.html page, but this is not happened. Maybe I do something wrong or I don't understand demo. Please give me some hints or correction? Thanks, Simon simon krizaj wrote: > Hello > I'm very new in Intraweb and until now everything look fine. I'...

How to center browser window?
Firefox 2.0 browser window opens on left side of monitor screen. I center it hoping on next use it will open centered, but it always opens on the left side. I can't find an "Option" that deals with this. Thanks for any helpful replies. WS ...

Center pages in browser
Hello, I am using Asp.net 1.1. The asp pages in my application are design to fit a 1024x768 resolution.  Lots of people have bigger resolution and when they browse in my application, the pages show at the left and there is lot a free space at right.  What I would like to do is to have my pages center in the browser and get free space both at the right and at the left proportionnal to the browser width (margin).  Also, to give a better look, I would like to be able to place a background in both right margin and left margin.  I can't figure how to to this...

Centering the page in the Browser!
Hi guys, i use Visual Basic Net (web project) to do a web page but i would like to know how can i make the page always centered in the browser? Thanks William! Between your HTML open and close tags, enclose everything inside DIV tags: <html> <div align="center"> 'all your page data/info goes here </div> </html>David WierMCP/ASPInsiderASPNet101.com - where to look first!Please Vote for ASPNet101 - 'Best Community Resource'!Control Grouper - easily control properties for multiple controls with one control!Calend...

How to center my website in the browser?
Hi   It could be a very simple answer but i cannot find the way to center my website in the browser. Every time i do a debugging to preview the website i am building in my IE/Firefox browser, a see everything align to the left. I cant find where i shoudl change that since when i am building the website in the WYSIWYG screen everything seems very centered.  Thanks in advance for your answer!! JD  <div style="margin: 0 auto; width: 900px;">   Your content here</div>Change the width as per your wish!When you ask a question, remember to clic...

How to center a page in the browser
I was wondering how to get your page centered in a browser window for in case your viewer has a resolution of 1280*1024I tried to look at asp.net starterkit personal website, but I couldn't find it. Help would be greatly appreciated. You'll need to put your page content in a table and set the width="100%".||| Kristopher Cargile||| http://www.kriscargile.com/blog/ From here: http://forums.devshed.com/t166611/s.html%22 <body style="text-align: center;"> <div id="centered_div" style="margin-left: auto; margin-right: auto; text-align: left;"> blah blah blah </div>...

Intraweb in Delphi 2009
Hi all. How can i do a Intraweb project in Delphi 9? Sergio Enrique Luna wrote: > Hi all. > > How can i do a Intraweb project in Delphi 9? http://www.drbob42.com/examine/examinA1.htm -- Steve Faleiro ...

Delphi Xe7 with Intraweb
Dear Developers Friends, I was developing using Delphi 6 for 10 years, and recently I acquired the Delphi XE6 and when the license arrived the Delphi XE7 was launched. I was using Delphi XE6 trial version to do a test because I need to developers an intraweb applicaton, then when I execute the port that diplayed to the server to connect to the application is one different of another at time that I run, I think this is a limitation of the trial version, and I believed that I will don't have a problem when I installed the licensed version. But, for my surprise, the problem continuous ...

Delphi Intraweb 2009
Is there a solution for the error "Cannot find submit component" error in new version of IntraWeb? > Is there a solution for the error "Cannot find submit component" error in new version of IntraWeb? See thread about version 10.0.6 -- Jackson Gomes IntraWeb Support > {quote:title=gary hopwood wrote:}{quote} > Is there a solution for the error "Cannot find submit component" error in new version of IntraWeb? did you find the solution, i have the same error message? >> Is there a solution for the error "Cannot find submit compon...

How to center browser window
Recently, my Firefox 2.0 browser window always opens at the left side of the monitor screen. I center it, but the next use always produces the previous result. How can I assure the browser window always opens centered? Thanks in advance for helpful replies. WS ...

Web resources about - Center a region in the browser - embarcadero.delphi.intraweb

Blind Browser
Nifty idea from Charlie Deets: a browser for web designers working on retina displays, to test how sites look on non-retina displays.

Nokia Browser for Symbian - Wikipedia, the free encyclopedia
Copy paste support is poor. If you have a device with no Control-key or Pen-key, you can not copy paste in most web forms. With older Nokia models, ...

Obscura Camera 2.0 introduces Photos edit extension and improved photo browser
... edit extension lets you apply Obscuras wonderful filters on photos you may have taken with other, lesser camera apps. Improved photo browser ...

Apple's Safari browser turns 13 years old today
Steve Jobs unveiled the "Fastest Web Browser Ever Created for the Mac" this day back in 2003, introducing the Safari web browser that four years ...

Price Drop: Life Web Browser
Life Web Browser 1.5 Device: iOS Universal Category: Productivity Price: Free, Version: 1.5 ( iTunes ) Description: Life Web Browser is Universal! ...

Last chance to upgrade IE or switch browsers as Microsoft's mandate looms
Nearly 340 million people who run Microsoft's Internet Explorer have just a week to upgrade or switch browsers, or face a shutoff of the security ...

Zspace created a virtual reality browser and I used it
... so 2015. It's the new year now, and to go along with that, zSpace has come up with a new way to browse the web: via virtual reality. The browser ...

Microsoft Stops Support of Pre-Internet Explorer 11 Browsers
Microsoft bids farewell to pre-Internet Explorer 11 browsers; Cisco helps businesses deal with shadow IT; Moto smartphones are getting fingerprint ...

Comcast Appears to Be Injecting Browser Pop-Ups to Upsell Crappy Modem Deals
Comcast sneakily injecting pop-up ads into user’s browsers is one of the company’s older and shitter tactics. But using those unsolicited ads ...

'Trump Filter' Erases The Donald From Your Chrome Browser
It's like building a giant wall to keep The Donald out! Trump Filter , developed by Rob Spectre, is a new Google Chrome extension that claims ...

Resources last updated: 1/15/2016 9:43:30 PM