From: <dos...@us...> - 2012-07-16 11:16:00
|
Revision: 4502 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4502&view=rev Author: doskabouter Date: 2012-07-16 11:15:51 +0000 (Mon, 16 Jul 2012) Log Message: ----------- Added possibility for skinners to define the area of the statusbar and webbrowser control Modified Paths: -------------- trunk/plugins/BrowseTheWeb/Release/Skin/Default/browsetheweb.xml trunk/plugins/BrowseTheWeb/Release/Skin/DefaultWide/browsetheweb.xml trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs Modified: trunk/plugins/BrowseTheWeb/Release/Skin/Default/browsetheweb.xml =================================================================== --- trunk/plugins/BrowseTheWeb/Release/Skin/Default/browsetheweb.xml 2012-07-16 11:10:09 UTC (rev 4501) +++ trunk/plugins/BrowseTheWeb/Release/Skin/Default/browsetheweb.xml 2012-07-16 11:15:51 UTC (rev 4502) @@ -5,24 +5,34 @@ <allowoverlay>no</allowoverlay> <disabletopbar>true</disabletopbar> <controls> - <control> + <control> <description>background image</description> <type>image</type> <id>1</id> <width>720</width> <height>576</height> </control> - + <control> + <description>Placeholder for browser component. If statusvisible=true, then bottom coordinate is decreased by the height of control with id of 545376891</description> + <type>image</type> + <id>545376890</id> + <width>720</width> + <height>576</height> + </control> + + <control> <description>Status label</description> <type>label</type> - <id>9</id> + <id>545376891</id> <posX>7</posX> <posY>540</posY> <label>#btWeb.status</label> <font>font12</font> <align>left</align> <textcolor>ffffffff</textcolor> + <height>36</height> + <visible>string.equals(#btWeb.statusvisible, true)</visible> </control> <control> <description>Link id label</description> @@ -34,6 +44,8 @@ <font>font10</font> <align>left</align> <textcolor>ffffffff</textcolor> + <height>36</height> + <visible>string.equals(#btWeb.statusvisible, true)</visible> </control> </controls> Modified: trunk/plugins/BrowseTheWeb/Release/Skin/DefaultWide/browsetheweb.xml =================================================================== --- trunk/plugins/BrowseTheWeb/Release/Skin/DefaultWide/browsetheweb.xml 2012-07-16 11:10:09 UTC (rev 4501) +++ trunk/plugins/BrowseTheWeb/Release/Skin/DefaultWide/browsetheweb.xml 2012-07-16 11:15:51 UTC (rev 4502) @@ -5,24 +5,34 @@ <allowoverlay>no</allowoverlay> <disabletopbar>true</disabletopbar> <controls> - <control> + <control> <description>background image</description> <type>image</type> <id>1</id> <width>1280</width> <height>720</height> </control> - + <control> + <description>Placeholder for browser component. If statusvisible=true, then bottom coordinate is decreased by the height of control with id of 545376891</description> + <type>image</type> + <id>545376890</id> + <width>1280</width> + <height>720</height> + </control> + + <control> <description>Status label</description> <type>label</type> - <id>9</id> + <id>545376891</id> <posX>7</posX> <posY>690</posY> <label>#btWeb.status</label> <font>font12</font> <align>left</align> <textcolor>ffffffff</textcolor> + <height>36</height> + <visible>string.equals(#btWeb.statusvisible, true)</visible> </control> <control> <description>Link id label</description> @@ -34,6 +44,8 @@ <font>font10</font> <align>left</align> <textcolor>ffffffff</textcolor> + <height>36</height> + <visible>string.equals(#btWeb.statusvisible, true)</visible> </control> </controls> Modified: trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs =================================================================== --- trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs 2012-07-16 11:10:09 UTC (rev 4501) +++ trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs 2012-07-16 11:15:51 UTC (rev 4502) @@ -215,6 +215,38 @@ #endregion } + private void SetBrowserWindow() + { + GUIControl cntrol = GetControl(545376890); + GUIControl statusBar = GetControl(545376891); + GUIPropertyManager.SetProperty("#btWeb.statusvisible", settings.StatusBar.ToString()); + + Point loc; + int w, h; + if (cntrol != null && statusBar != null) + { + loc = new Point(cntrol.XPosition, cntrol.YPosition); + w = cntrol.Width; + + if (settings.StatusBar) + h = cntrol.Height - statusBar.Height; + else + h = cntrol.Height; + } + else + { + loc = new Point(0, 0); + w = GUIGraphicsContext.form.Width; + if (settings.StatusBar) + h = GUIGraphicsContext.form.Height - 100; + else + h = GUIGraphicsContext.form.Height; + } + + webBrowser.Location = loc; + webBrowser.Size = new Size(w, h); + } + protected override void OnPageLoad() { GUIPropertyManager.SetProperty("#currentmodule", settings.PluginName); @@ -247,7 +279,7 @@ webBrowser.Enabled = settings.UseMouse; webBrowser.Dock = DockStyle.None; - webBrowser.Location = new System.Drawing.Point(0, 0); + SetBrowserWindow(); MyLog.debug("Create eventhandler"); @@ -258,11 +290,6 @@ webBrowser.DomKeyDown += new GeckoDomKeyEventHandler(webBrowser_DomKeyDown); webBrowser.DomClick += new GeckoDomEventHandler(webBrowser_DomClick); - if (settings.StatusBar) - webBrowser.Size = new System.Drawing.Size(GUIGraphicsContext.form.Width, GUIGraphicsContext.form.Height - 100); - else - webBrowser.Size = new System.Drawing.Size(GUIGraphicsContext.form.Width, GUIGraphicsContext.form.Height); - MyLog.debug("set zoom size to " + settings.FontZoom + "/" + zoom); webBrowser.Window.TextZoom = settings.FontZoom; @@ -469,10 +496,7 @@ if (action.wID == settings.Remote_Status) { settings.StatusBar = !settings.StatusBar; - if (settings.StatusBar) - webBrowser.Size = new System.Drawing.Size(GUIGraphicsContext.form.Width, GUIGraphicsContext.form.Height - 100); - else - webBrowser.Size = new System.Drawing.Size(GUIGraphicsContext.form.Width, GUIGraphicsContext.form.Height); + SetBrowserWindow(); } if (action.wID == settings.Remote_PageUp) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |