From: <Ven...@us...> - 2008-11-22 06:53:17
|
Revision: 2468 http://planeshift.svn.sourceforge.net/planeshift/?rev=2468&view=rev Author: Vengeance2001 Date: 2008-11-22 06:53:15 +0000 (Sat, 22 Nov 2008) Log Message: ----------- Added support for specifying bold text in a widget xml doc. Just add bold="yes" to the font tag if you want it bold. (shadow="yes" is already supported) Modified Paths: -------------- trunk/src/common/paws/pawswidget.cpp Modified: trunk/src/common/paws/pawswidget.cpp =================================================================== --- trunk/src/common/paws/pawswidget.cpp 2008-11-22 06:45:55 UTC (rev 2467) +++ trunk/src/common/paws/pawswidget.cpp 2008-11-22 06:53:15 UTC (rev 2468) @@ -439,6 +439,8 @@ if (fontAttribute->GetAttributeValueAsBool( "shadow" )) fontStyle |= FONT_STYLE_DROPSHADOW; + if (fontAttribute->GetAttributeValueAsBool( "bold" )) + fontStyle |= FONT_STYLE_BOLD; } // Get the frame for this widget. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wel...@us...> - 2009-08-03 07:59:32
|
Revision: 4172 http://planeshift.svn.sourceforge.net/planeshift/?rev=4172&view=rev Author: weltall2 Date: 2009-08-03 07:59:25 +0000 (Mon, 03 Aug 2009) Log Message: ----------- Added dynamic image loading when missing from the texturemanager cache Modified Paths: -------------- trunk/src/common/paws/pawswidget.cpp Modified: trunk/src/common/paws/pawswidget.cpp =================================================================== --- trunk/src/common/paws/pawswidget.cpp 2009-08-03 07:58:54 UTC (rev 4171) +++ trunk/src/common/paws/pawswidget.cpp 2009-08-03 07:59:25 UTC (rev 4172) @@ -931,8 +931,20 @@ if ( parent ) parentName = parent->GetName(); - Warning4( LOG_PAWS, "Widget: %s (Parent: %s) Could Not load image: %s", name.GetData(), parentName.GetData(), image ); - return; + if(PawsManager::GetSingleton().GetTextureManager()->AddImage(image)) //try on demand loading + { + //try getting the image again + bgImage = PawsManager::GetSingleton().GetTextureManager()->GetPawsImage(image); + } + if(!bgImage) + { + Warning4(LOG_PAWS, "Widget: %s (Parent: %s) Could Not load image: %s", name.GetData(), parentName.GetData(), image ); + return; + } + else + { + Warning4(LOG_PAWS, "Widget: %s (Parent: %s) The image %s was missing from the imagelist.xml and was loaded on demand. Add the image there!", name.GetData(), parentName.GetData(), image ); + } } alpha = bgImage->GetDefaultAlpha(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wel...@us...> - 2009-11-29 19:27:05
|
Revision: 4830 http://planeshift.svn.sourceforge.net/planeshift/?rev=4830&view=rev Author: weltall2 Date: 2009-11-29 19:26:57 +0000 (Sun, 29 Nov 2009) Log Message: ----------- fixed missing ) Modified Paths: -------------- trunk/src/common/paws/pawswidget.cpp Modified: trunk/src/common/paws/pawswidget.cpp =================================================================== --- trunk/src/common/paws/pawswidget.cpp 2009-11-29 17:11:34 UTC (rev 4829) +++ trunk/src/common/paws/pawswidget.cpp 2009-11-29 19:26:57 UTC (rev 4830) @@ -1543,7 +1543,7 @@ #ifdef CS_PLATFORM_MACOSX else if ((button == csmbRight) || (button == csmbLeft && modifiers == CSMASK_CTRL)) #else - else if ((button == csmbRight) + else if ((button == csmbRight)) #endif { if (!contextMenu && !contextMenuFile.IsEmpty()) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wel...@us...> - 2009-12-15 20:52:31
|
Revision: 4977 http://planeshift.svn.sourceforge.net/planeshift/?rev=4977&view=rev Author: weltall2 Date: 2009-12-15 20:52:25 +0000 (Tue, 15 Dec 2009) Log Message: ----------- added tooltip translation from xml Modified Paths: -------------- trunk/src/common/paws/pawswidget.cpp Modified: trunk/src/common/paws/pawswidget.cpp =================================================================== --- trunk/src/common/paws/pawswidget.cpp 2009-12-15 20:47:02 UTC (rev 4976) +++ trunk/src/common/paws/pawswidget.cpp 2009-12-15 20:52:25 UTC (rev 4977) @@ -388,8 +388,8 @@ atr = node->GetAttribute( "tooltip" ); if (atr) { - toolTip = atr->GetValue(); - defaultToolTip =toolTip; + toolTip = PawsManager::GetSingleton().Translate(atr->GetValue()); + defaultToolTip = toolTip; } bool inheritFont = true; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wel...@us...> - 2010-01-02 19:53:38
|
Revision: 5136 http://planeshift.svn.sourceforge.net/planeshift/?rev=5136&view=rev Author: weltall2 Date: 2010-01-02 19:53:27 +0000 (Sat, 02 Jan 2010) Log Message: ----------- starting an implementation of a copy constructor to paws widget... altough i think the entire library must have one too in each sub component in order to work Modified Paths: -------------- trunk/src/common/paws/pawswidget.cpp Modified: trunk/src/common/paws/pawswidget.cpp =================================================================== --- trunk/src/common/paws/pawswidget.cpp 2010-01-02 10:23:43 UTC (rev 5135) +++ trunk/src/common/paws/pawswidget.cpp 2010-01-02 19:53:27 UTC (rev 5136) @@ -108,6 +108,61 @@ scriptEvents[a] = 0; } +pawsWidget::pawsWidget(const pawsWidget &origin) +{ + graphics2D = PawsManager::GetSingleton().GetGraphics2D(); + + screenFrame = csRect(origin.screenFrame); + clipRect = csRect(origin.clipRect); + saveWidgetPositions = origin.saveWidgetPositions; + + visible = origin.visible; + movable = origin.movable; + alwaysOnTop = origin.alwaysOnTop; + isResizable = origin.isResizable; + showResize = origin.showResize; + resizeToScreen = origin.resizeToScreen; + keepaspect = origin.keepaspect; + scaleFont = origin.scaleFont; + needsRender = origin.needsRender; + parentDraw = origin.parentDraw; + id = origin.id; + parent = NULL; + bgColour = origin.bgColour; + border = NULL; + name = origin.name; + attachFlags = origin.attachFlags; + fadeVal = origin.fadeVal; + fadeSpeed = origin.fadeSpeed; + fade = origin.fade; + alphaMin = origin.alphaMin; + alpha = origin.alpha; + hasFocus = origin.hasFocus; + hasMouseFocus = origin.hasMouseFocus; + configurable = origin.configurable; + fontStyle = origin.fontStyle; + min_height = origin.min_height; + min_width = origin.min_width; + max_height = origin.max_height; + max_width = origin.max_width; + hasBorderColours = origin.hasBorderColours; + contextMenu = NULL; + xmlbinding.Clear(); + ignore = origin.ignore; + onEnter = NULL; + margin = origin.margin; + close_widget = origin.close_widget; + extraData = origin.extraData; + defaultFontColour = origin.defaultFontColour; + defaultFontSize = origin.defaultFontSize; + fontSize = origin.fontSize; + titleBar = origin.titleBar; + + size_t a; + for (a=0; a<PW_SCRIPT_EVENT_COUNT; ++a) + scriptEvents[a] = origin.scriptEvents[a]; +} + pawsWidget::~pawsWidget() { // Check to see if the widget position should be save. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wel...@us...> - 2010-03-18 18:12:41
|
Revision: 5703 http://planeshift.svn.sourceforge.net/planeshift/?rev=5703&view=rev Author: weltall2 Date: 2010-03-18 18:12:31 +0000 (Thu, 18 Mar 2010) Log Message: ----------- cleanup patch by rlydontknow Modified Paths: -------------- trunk/src/common/paws/pawswidget.cpp Modified: trunk/src/common/paws/pawswidget.cpp =================================================================== --- trunk/src/common/paws/pawswidget.cpp 2010-03-18 18:11:52 UTC (rev 5702) +++ trunk/src/common/paws/pawswidget.cpp 2010-03-18 18:12:31 UTC (rev 5703) @@ -794,7 +794,7 @@ } Resize(); - Resize( 0, 0, RESIZE_RIGHT | RESIZE_BOTTOM | RESIZE_TOP | RESIZE_BOTTOM ); + Resize( 0, 0, RESIZE_RIGHT | RESIZE_LEFT | RESIZE_TOP | RESIZE_BOTTOM ); StopResize(); if (visible) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wel...@us...> - 2010-12-20 09:32:46
|
Revision: 6554 http://planeshift.svn.sourceforge.net/planeshift/?rev=6554&view=rev Author: weltall2 Date: 2010-12-20 09:32:40 +0000 (Mon, 20 Dec 2010) Log Message: ----------- removed some mystic code which makes nonsense and makes window get to top when they show things like a scrollbar Modified Paths: -------------- trunk/src/common/paws/pawswidget.cpp Modified: trunk/src/common/paws/pawswidget.cpp =================================================================== --- trunk/src/common/paws/pawswidget.cpp 2010-12-20 09:10:12 UTC (rev 6553) +++ trunk/src/common/paws/pawswidget.cpp 2010-12-20 09:32:40 UTC (rev 6554) @@ -893,16 +893,18 @@ void pawsWidget::ShowBehind() { visible = true; - if ( border ) border->Show(); + if ( border ) border->ShowBehind(); - pawsWidget * focused = PawsManager::GetSingleton().GetCurrentFocusedWidget(); + //this mystic code makes nonsense. + //if a widget is focused why it should be shown, likewise why it should be brought to top? + /* pawsWidget * focused = PawsManager::GetSingleton().GetCurrentFocusedWidget(); if ( focused ) { if(focused->IsVisible()) BringToTop(focused); else focused->Show(); - } + }*/ } void pawsWidget::Show() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wel...@us...> - 2010-12-20 09:50:49
|
Revision: 6555 http://planeshift.svn.sourceforge.net/planeshift/?rev=6555&view=rev Author: weltall2 Date: 2010-12-20 09:50:41 +0000 (Mon, 20 Dec 2010) Log Message: ----------- fixed build Modified Paths: -------------- trunk/src/common/paws/pawswidget.cpp Modified: trunk/src/common/paws/pawswidget.cpp =================================================================== --- trunk/src/common/paws/pawswidget.cpp 2010-12-20 09:32:40 UTC (rev 6554) +++ trunk/src/common/paws/pawswidget.cpp 2010-12-20 09:50:41 UTC (rev 6555) @@ -893,7 +893,7 @@ void pawsWidget::ShowBehind() { visible = true; - if ( border ) border->ShowBehind(); + if ( border ) border->Show(); //this mystic code makes nonsense. //if a widget is focused why it should be shown, likewise why it should be brought to top? This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wel...@us...> - 2010-12-20 12:19:55
|
Revision: 6556 http://planeshift.svn.sourceforge.net/planeshift/?rev=6556&view=rev Author: weltall2 Date: 2010-12-20 12:19:49 +0000 (Mon, 20 Dec 2010) Log Message: ----------- fixed not resizing of some widgets Modified Paths: -------------- trunk/src/common/paws/pawswidget.cpp Modified: trunk/src/common/paws/pawswidget.cpp =================================================================== --- trunk/src/common/paws/pawswidget.cpp 2010-12-20 09:50:41 UTC (rev 6555) +++ trunk/src/common/paws/pawswidget.cpp 2010-12-20 12:19:49 UTC (rev 6556) @@ -2295,8 +2295,7 @@ } OnResize(); - - for ( size_t x = children.GetSize(); x-- > 0; ) + for(size_t x = 0; x < children.GetSize(); x++) { children[x]->Resize(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wel...@us...> - 2011-01-01 11:56:09
|
Revision: 6689 http://planeshift.svn.sourceforge.net/planeshift/?rev=6689&view=rev Author: weltall2 Date: 2011-01-01 11:56:03 +0000 (Sat, 01 Jan 2011) Log Message: ----------- use an initialization list for the ctor patch by mikesflowers Modified Paths: -------------- trunk/src/common/paws/pawswidget.cpp Modified: trunk/src/common/paws/pawswidget.cpp =================================================================== --- trunk/src/common/paws/pawswidget.cpp 2011-01-01 04:29:34 UTC (rev 6688) +++ trunk/src/common/paws/pawswidget.cpp 2011-01-01 11:56:03 UTC (rev 6689) @@ -53,113 +53,109 @@ // Construction/Destruction ////////////////////////////////////////////////////////////////////// -pawsWidget::pawsWidget( ) +pawsWidget::pawsWidget( ) : + id(-1), + parent(NULL), + defaultFrame(csRect(0, 0, 0, 0)), + screenFrame(csRect(0, 0, 0, 0)), + clipRect(csRect(0, 0, 0, 0)), + titleBar(NULL), + close_widget(NULL), + onEnter(NULL), + visible(true), + saveWidgetPositions(false), + configurable(false), + movable(false), + isResizable(false), + showResize(true), + resizeToScreen(false), + keepaspect(true), + alwaysOnTop(false), + min_width(DEFAULT_MIN_WIDTH), + min_height(DEFAULT_MIN_HEIGHT), + name("None"), + bgColour(-1), + border(NULL), + attachFlags(0), + hasFocus(false), + hasMouseFocus(false), + fadeVal(100), + alpha(0), + alphaMin(0), + fade(true), + fadeSpeed(8.0f), + contextMenu(NULL), + hasBorderColours(false), + defaultFontColour(-1), + defaultFontSize(10), + fontSize(10), + scaleFont(true), + fontStyle(0), + ignore(false), + margin(0), + extraData(NULL), + needsRender(false), + parentDraw(true) + { graphics2D = PawsManager::GetSingleton().GetGraphics2D(); - screenFrame = csRect(0,0,0,0); - clipRect = csRect(0,0,0,0); - saveWidgetPositions = false; - - visible = true; - movable = false; - alwaysOnTop = false; - isResizable = false; - showResize = true; - resizeToScreen = false; - keepaspect = true; - scaleFont = true; - needsRender = false; - parentDraw = true; - id = -1; - parent = NULL; - bgColour = -1; - border = NULL; - name = "None"; - attachFlags = 0; - fadeVal = 100; - fadeSpeed = 8.0f; - fade = true; - alphaMin=0; - alpha=0; - hasFocus = false; - hasMouseFocus=false; - configurable = false; - fontStyle = 0; - min_height = DEFAULT_MIN_HEIGHT; - min_width = DEFAULT_MIN_WIDTH; max_height = graphics2D->GetHeight(); max_width = graphics2D->GetWidth(); - hasBorderColours = false; - contextMenu = NULL; - xmlbinding.Clear(); - ignore = false; - onEnter = NULL; - margin = 0; - close_widget = 0; - extraData = 0; - defaultFontColour = -1; - defaultFontSize = 10; - fontSize = 10; - titleBar = 0; - size_t a; - for (a=0; a<PW_SCRIPT_EVENT_COUNT; ++a) + for(size_t a = 0; a < PW_SCRIPT_EVENT_COUNT; ++a) scriptEvents[a] = 0; } -pawsWidget::pawsWidget(const pawsWidget &origin) +pawsWidget::pawsWidget(const pawsWidget &origin) : + id(origin.id), + parent(NULL), + defaultFrame(csRect(0, 0, 0, 0)), + screenFrame(origin.screenFrame), + clipRect(origin.clipRect), + titleBar(origin.titleBar), + close_widget(origin.close_widget), + onEnter(NULL), + visible(origin.visible), + saveWidgetPositions(origin.saveWidgetPositions), + configurable(origin.configurable), + movable(origin.movable), + isResizable(origin.isResizable), + showResize(origin.showResize), + resizeToScreen(origin.resizeToScreen), + keepaspect(origin.keepaspect), + alwaysOnTop(origin.alwaysOnTop), + min_width(origin.min_width), + min_height(origin.min_height), + max_width(origin.max_width), + max_height(origin.max_height), + name(origin.name), + bgColour(origin.bgColour), + border(NULL), + attachFlags(origin.attachFlags), + hasFocus(origin.hasFocus), + hasMouseFocus(origin.hasMouseFocus), + fadeVal(origin.fadeVal), + alpha(origin.alpha), + alphaMin(origin.alphaMin), + fade(origin.fade), + fadeSpeed(origin.fadeSpeed), + contextMenu(NULL), + hasBorderColours(origin.hasBorderColours), + defaultFontColour(origin.defaultFontColour), + defaultFontSize(origin.defaultFontSize), + fontSize(origin.fontSize), + scaleFont(origin.scaleFont), + fontStyle(origin.fontStyle), + ignore(origin.ignore), + margin(origin.margin), + extraData(origin.extraData), + needsRender(origin.needsRender), + parentDraw(origin.parentDraw) { graphics2D = PawsManager::GetSingleton().GetGraphics2D(); - screenFrame = csRect(origin.screenFrame); - clipRect = csRect(origin.clipRect); - saveWidgetPositions = origin.saveWidgetPositions; - - visible = origin.visible; - movable = origin.movable; - alwaysOnTop = origin.alwaysOnTop; - isResizable = origin.isResizable; - showResize = origin.showResize; - resizeToScreen = origin.resizeToScreen; - keepaspect = origin.keepaspect; - scaleFont = origin.scaleFont; - needsRender = origin.needsRender; - parentDraw = origin.parentDraw; - id = origin.id; - parent = NULL; - bgColour = origin.bgColour; - border = NULL; - name = origin.name; - attachFlags = origin.attachFlags; - fadeVal = origin.fadeVal; - fadeSpeed = origin.fadeSpeed; - fade = origin.fade; - alphaMin = origin.alphaMin; - alpha = origin.alpha; - hasFocus = origin.hasFocus; - hasMouseFocus = origin.hasMouseFocus; - configurable = origin.configurable; - fontStyle = origin.fontStyle; - min_height = origin.min_height; - min_width = origin.min_width; - max_height = origin.max_height; - max_width = origin.max_width; - hasBorderColours = origin.hasBorderColours; - contextMenu = NULL; - xmlbinding.Clear(); - ignore = origin.ignore; - onEnter = NULL; - margin = origin.margin; - close_widget = origin.close_widget; - extraData = origin.extraData; - defaultFontColour = origin.defaultFontColour; - defaultFontSize = origin.defaultFontSize; - fontSize = origin.fontSize; - titleBar = origin.titleBar; - - size_t a; - for (a=0; a<PW_SCRIPT_EVENT_COUNT; ++a) + for(size_t a = 0; a < PW_SCRIPT_EVENT_COUNT; ++a) scriptEvents[a] = origin.scriptEvents[a]; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wel...@us...> - 2011-01-06 11:29:05
|
Revision: 6715 http://planeshift.svn.sourceforge.net/planeshift/?rev=6715&view=rev Author: weltall2 Date: 2011-01-06 11:28:59 +0000 (Thu, 06 Jan 2011) Log Message: ----------- fixed font scaling not being saved Modified Paths: -------------- trunk/src/common/paws/pawswidget.cpp Modified: trunk/src/common/paws/pawswidget.cpp =================================================================== --- trunk/src/common/paws/pawswidget.cpp 2011-01-06 11:17:30 UTC (rev 6714) +++ trunk/src/common/paws/pawswidget.cpp 2011-01-06 11:28:59 UTC (rev 6715) @@ -1388,6 +1388,9 @@ configName.Format("PlaneShift.GUI.%s.Fade", GetName()); cfgMgr->SetBool(configName, fade); + configName.Format("PlaneShift.GUI.%s.ScaleFont", GetName()); + cfgMgr->SetBool(configName, scaleFont); + cfgMgr->Save(); } @@ -1407,8 +1410,12 @@ configName.Format("PlaneShift.GUI.%s.Fade", GetName()); fade = cfgMgr->GetBool(configName, fade); + configName.Format("PlaneShift.GUI.%s.ScaleFont", GetName()); + fade = cfgMgr->GetBool(configName, scaleFont); + configName.Format("PlaneShift.GUI.%s.FadeSpeed", GetName()); fadeSpeed = cfgMgr->GetFloat(configName, fadeSpeed); + } void pawsWidget::CreateWidgetConfigWindow() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wel...@us...> - 2011-01-08 15:39:55
|
Revision: 6726 http://planeshift.svn.sourceforge.net/planeshift/?rev=6726&view=rev Author: weltall2 Date: 2011-01-08 15:39:49 +0000 (Sat, 08 Jan 2011) Log Message: ----------- additional fix for PS#1210 - Chatwindow-font is enlarged after using the settings-window for alpha-value by f-rd Modified Paths: -------------- trunk/src/common/paws/pawswidget.cpp Modified: trunk/src/common/paws/pawswidget.cpp =================================================================== --- trunk/src/common/paws/pawswidget.cpp 2011-01-08 15:33:57 UTC (rev 6725) +++ trunk/src/common/paws/pawswidget.cpp 2011-01-08 15:39:49 UTC (rev 6726) @@ -1417,7 +1417,7 @@ fade = cfgMgr->GetBool(configName, fade); configName.Format("PlaneShift.GUI.%s.ScaleFont", GetName()); - fade = cfgMgr->GetBool(configName, scaleFont); + scaleFont = cfgMgr->GetBool(configName, scaleFont); configName.Format("PlaneShift.GUI.%s.FadeSpeed", GetName()); fadeSpeed = cfgMgr->GetFloat(configName, fadeSpeed); @@ -2314,8 +2314,7 @@ { if (screenFrame.Width() && defaultFrame.Height()) { - float newSize = defaultFontSize * float(screenFrame.Width())/float(defaultFrame.Width()); - ChangeFontSize(newSize); + SetFontScaling(true); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wel...@us...> - 2011-01-10 14:30:55
|
Revision: 6743 http://planeshift.svn.sourceforge.net/planeshift/?rev=6743&view=rev Author: weltall2 Date: 2011-01-10 14:30:47 +0000 (Mon, 10 Jan 2011) Log Message: ----------- from when modal widgets give events to their parents? Modified Paths: -------------- trunk/src/common/paws/pawswidget.cpp Modified: trunk/src/common/paws/pawswidget.cpp =================================================================== --- trunk/src/common/paws/pawswidget.cpp 2011-01-10 00:41:25 UTC (rev 6742) +++ trunk/src/common/paws/pawswidget.cpp 2011-01-10 14:30:47 UTC (rev 6743) @@ -1620,7 +1620,7 @@ } } - if ( parent ) + if ( parent && PawsManager::GetSingleton().GetModalWidget() != this ) return parent->OnMouseDown( button, modifiers, x, y ); return false; @@ -1650,7 +1650,7 @@ bool pawsWidget::OnMouseUp( int button, int modifiers, int x, int y ) { - if ( parent ) + if ( parent && PawsManager::GetSingleton().GetModalWidget() != this) return parent->OnMouseUp( button, modifiers, x, y ); else { @@ -1660,7 +1660,7 @@ bool pawsWidget::OnDoubleClick( int button, int modifiers, int x, int y ) { - if ( parent ) + if ( parent && PawsManager::GetSingleton().GetModalWidget() != this) { return parent->OnDoubleClick( button, modifiers, x, y ); } @@ -1672,7 +1672,7 @@ bool pawsWidget::OnJoypadDown( int button, int modifiers ) { - if ( parent ) + if ( parent && PawsManager::GetSingleton().GetModalWidget() != this) { return parent->OnJoypadDown( button, modifiers); } @@ -1686,7 +1686,7 @@ { if (key == CSKEY_ENTER) { - if (!onEnter && parent) + if (!onEnter && parent && PawsManager::GetSingleton().GetModalWidget() != this) return parent->OnKeyDown(keyCode,key,modifiers); onEnter->OnMouseDown(1,0,0,0) ; @@ -1751,7 +1751,7 @@ return true; } } - if ( parent ) + if ( parent && PawsManager::GetSingleton().GetModalWidget() != this) return parent->OnKeyDown( keyCode, key, modifiers ); return false; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wel...@us...> - 2011-02-07 19:13:35
|
Revision: 6887 http://planeshift.svn.sourceforge.net/planeshift/?rev=6887&view=rev Author: weltall2 Date: 2011-02-07 19:13:29 +0000 (Mon, 07 Feb 2011) Log Message: ----------- looks like someone didn't know that when not wrapping code in {} after if only the first one is under the if Modified Paths: -------------- trunk/src/common/paws/pawswidget.cpp Modified: trunk/src/common/paws/pawswidget.cpp =================================================================== --- trunk/src/common/paws/pawswidget.cpp 2011-02-07 19:10:03 UTC (rev 6886) +++ trunk/src/common/paws/pawswidget.cpp 2011-02-07 19:13:29 UTC (rev 6887) @@ -2700,8 +2700,10 @@ void pawsWidget::RemoveTitle() { if(border) + { border->SetTitle(NULL); border->SetTitleImage(NULL); + } if(close_widget) close_widget->DeleteYourself(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wel...@us...> - 2011-02-27 20:59:10
|
Revision: 7015 http://planeshift.svn.sourceforge.net/planeshift/?rev=7015&view=rev Author: weltall2 Date: 2011-02-27 20:59:04 +0000 (Sun, 27 Feb 2011) Log Message: ----------- fixed PS#5008 - client crashes when hitting the enter key Modified Paths: -------------- trunk/src/common/paws/pawswidget.cpp Modified: trunk/src/common/paws/pawswidget.cpp =================================================================== --- trunk/src/common/paws/pawswidget.cpp 2011-02-27 20:08:08 UTC (rev 7014) +++ trunk/src/common/paws/pawswidget.cpp 2011-02-27 20:59:04 UTC (rev 7015) @@ -1686,11 +1686,18 @@ { if (key == CSKEY_ENTER) { - if (!onEnter && parent && PawsManager::GetSingleton().GetModalWidget() != this) - return parent->OnKeyDown(keyCode,key,modifiers); + if(!onEnter) + { + if(parent && PawsManager::GetSingleton().GetModalWidget() != this) + return parent->OnKeyDown(keyCode,key,modifiers); + //else we ignore the command and proceed + } + else + { + onEnter->OnMouseDown(1,0,0,0); + } + return true; - onEnter->OnMouseDown(1,0,0,0) ; - return true; } bool tab = false; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wel...@us...> - 2011-03-24 20:24:58
|
Revision: 7100 http://planeshift.svn.sourceforge.net/planeshift/?rev=7100&view=rev Author: weltall2 Date: 2011-03-24 20:24:52 +0000 (Thu, 24 Mar 2011) Log Message: ----------- changed some code to use cs implementation Modified Paths: -------------- trunk/src/common/paws/pawswidget.cpp Modified: trunk/src/common/paws/pawswidget.cpp =================================================================== --- trunk/src/common/paws/pawswidget.cpp 2011-03-22 20:02:59 UTC (rev 7099) +++ trunk/src/common/paws/pawswidget.cpp 2011-03-24 20:24:52 UTC (rev 7100) @@ -347,85 +347,40 @@ ReadDefaultWidgetStyles(node); - atr = node->GetAttribute("ignore"); - if ( atr ) - { - csString choice = csString( atr->GetValue() ); - if ( choice == "yes" ) ignore = true; - if ( choice == "no" ) ignore = false; - } + //if we don't find the attribute we set the previous one + ignore = node->GetAttributeValueAsBool("ignore", ignore); + // Check to see if this widget is visible directly after a load. - atr = node->GetAttribute( "visible" ); - if ( atr ) + if(node->GetAttributeValueAsBool("visible", visible)) { - csString choice = csString( atr->GetValue() ); - if ( choice == "yes" ) Show(); - if ( choice == "no" ) Hide(); + Show(); } - - - // Check to see if this widget should save it's position - atr = node->GetAttribute("savepositions"); - if ( atr ) + else { - csString choice = csString(atr->GetValue()); - if ( choice == "yes" ) saveWidgetPositions = true; - if ( choice == "no" ) saveWidgetPositions = false; + Hide(); } + // Check to see if this widget should save it's position + saveWidgetPositions = node->GetAttributeValueAsBool("savepositions", saveWidgetPositions); + // Check to see if this widget is movable - atr = node->GetAttribute("movable"); - if ( atr ) - { - csString choice = csString(atr->GetValue()); - if ( choice == "yes" ) movable = true; - if ( choice == "no" ) movable = false; - } + movable = node->GetAttributeValueAsBool("movable", movable); // Check to see if this widget is configurable - atr = node->GetAttribute("configurable"); - if ( atr ) - { - csString choice = csString(atr->GetValue()); - if ( choice == "yes" ) configurable = true; - if ( choice == "no" ) configurable = false; - } + configurable = node->GetAttributeValueAsBool("configurable", configurable); - atr = node->GetAttribute( "resizable" ); - if ( atr ) - { - csString choice = csString(atr->GetValue()); - if ( choice == "yes" ) isResizable = true; - if ( choice == "no" ) isResizable = false; - } + resizable = node->GetAttributeValueAsBool("resizable", resizable); - atr = node->GetAttribute( "resizetoscreen" ); - if(atr) - { - resizeToScreen = atr->GetValueAsBool(); - } - else if(parent) - { - resizeToScreen = parent->resizeToScreen; - } + resizeToScreen = node->GetAttributeValueAsBool("resizetoscreen", parent->resizeToScreen); - atr = node->GetAttribute( "keepaspect" ); - if(atr) - { - csString choice = csString(atr->GetValue()); - if ( choice == "no" ) keepaspect = false; - } + keepaspect = node->GetAttributeValueAsBool("keepaspect", keepaspect ); atr = node->GetAttribute( "ContextMenu" ); if ( atr ) contextMenuFile = atr->GetValue(); - atr = node->GetAttribute( "id" ); - if ( atr ) - { - id = atr->GetValueAsInt(); - } + id = node->GetAttributeValueAsInt("id", id); atr = node->GetAttribute( "xmlbinding" ); if ( atr ) @@ -433,7 +388,7 @@ xmlbinding = atr->GetValue(); } - alwaysOnTop = node->GetAttributeValueAsBool( "alwaysontop", false ); + alwaysOnTop = node->GetAttributeValueAsBool("alwaysontop", alwaysOnTop); // Get tool tip, if any atr = node->GetAttribute( "tooltip" ); @@ -508,14 +463,14 @@ defaultFontShadowColour = graphics2D->FindRGB( r, g, b ); - if (fontAttribute->GetAttributeValueAsBool( "shadow" )) + if (fontAttribute->GetAttributeValueAsBool("shadow")) fontStyle |= FONT_STYLE_DROPSHADOW; - if (fontAttribute->GetAttributeValueAsBool( "bold" )) + if (fontAttribute->GetAttributeValueAsBool("bold")) fontStyle |= FONT_STYLE_BOLD; } // Get the frame for this widget. - csRef<iDocumentNode> frameNode = node->GetNode( "frame" ); + csRef<iDocumentNode> frameNode = node->GetNode("frame"); if ( frameNode ) { defaultFrame.xmin = GetActualWidth(frameNode->GetAttributeValueAsInt("x")); @@ -563,19 +518,11 @@ if ( border ) { - csRef<iDocumentAttribute> useJustTitle = frameNode->GetAttribute("justtitle"); - if ( useJustTitle ) - { - csString useJustTitleString = useJustTitle->GetValue(); - - if ( useJustTitleString != "no" ) - border->JustTitle(); - } + if(frameNode->GetAttributeAsBool("justtitle", false)) + border->JustTitle(); } - atr = frameNode->GetAttribute( "margin" ); - if (atr) - margin = atr->GetValueAsInt(); + margin = frameNode->GetAttributeAsInt("margin", margin); } // Process title bar, if any @@ -633,13 +580,11 @@ alpha = bgImage->GetDefaultAlpha(); //alphaMax = alpha; - csRef<iDocumentAttribute> fadeattr = bgImageNode->GetAttribute("fading"); - if (fadeattr) - fade = fadeattr->GetValueAsBool(); + fade = bgImageNode->GetAttributeValueAsBool("fading", fade); } } - if ( configurable ) + if(configurable) { LoadSettings(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wel...@us...> - 2011-03-24 22:16:58
|
Revision: 7102 http://planeshift.svn.sourceforge.net/planeshift/?rev=7102&view=rev Author: weltall2 Date: 2011-03-24 22:16:52 +0000 (Thu, 24 Mar 2011) Log Message: ----------- fixed bootup crash Modified Paths: -------------- trunk/src/common/paws/pawswidget.cpp Modified: trunk/src/common/paws/pawswidget.cpp =================================================================== --- trunk/src/common/paws/pawswidget.cpp 2011-03-24 21:33:11 UTC (rev 7101) +++ trunk/src/common/paws/pawswidget.cpp 2011-03-24 22:16:52 UTC (rev 7102) @@ -372,7 +372,7 @@ isResizable = node->GetAttributeValueAsBool("resizable", isResizable); - resizeToScreen = node->GetAttributeValueAsBool("resizetoscreen", parent->resizeToScreen); + resizeToScreen = node->GetAttributeValueAsBool("resizetoscreen", parent? parent->resizeToScreen : resizeToScreen); keepaspect = node->GetAttributeValueAsBool("keepaspect", keepaspect ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wel...@us...> - 2012-01-26 14:28:30
|
Revision: 8045 http://planeshift.svn.sourceforge.net/planeshift/?rev=8045&view=rev Author: weltall2 Date: 2012-01-26 14:28:24 +0000 (Thu, 26 Jan 2012) Log Message: ----------- added Show() Hide() method to pawsscripting Modified Paths: -------------- trunk/src/common/paws/pawswidget.cpp Modified: trunk/src/common/paws/pawswidget.cpp =================================================================== --- trunk/src/common/paws/pawswidget.cpp 2012-01-25 14:37:16 UTC (rev 8044) +++ trunk/src/common/paws/pawswidget.cpp 2012-01-26 14:28:24 UTC (rev 8045) @@ -2858,7 +2858,7 @@ return 0.0; } -double pawsWidget::CalcFunction(MathEnvironment* /*env*/, const char* functionName, const double* params) +double pawsWidget::CalcFunction(MathEnvironment* env, const char* functionName, const double* params) { if (!strcasecmp(functionName, "closeparent")) { @@ -2868,6 +2868,20 @@ w->Close(); return 0.0; } + else if (!strcasecmp(functionName, "Show")) + { + Show(); + return 0.0; + } + else if (!strcasecmp(functionName, "Hide")) + { + Hide(); + return 0.0; + } + /*else if(parent) + { + return parent->CalcFunction(env, functionName, params); + }*/ Error2("pawsWidget::CalcFunction(%s) failed\n", functionName); return 0.0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wel...@us...> - 2012-04-17 07:57:15
|
Revision: 8217 http://planeshift.svn.sourceforge.net/planeshift/?rev=8217&view=rev Author: weltall2 Date: 2012-04-17 07:57:04 +0000 (Tue, 17 Apr 2012) Log Message: ----------- avoid loading font if not defined, so the default per style or per parent is used Modified Paths: -------------- trunk/src/common/paws/pawswidget.cpp Modified: trunk/src/common/paws/pawswidget.cpp =================================================================== --- trunk/src/common/paws/pawswidget.cpp 2012-04-16 20:13:15 UTC (rev 8216) +++ trunk/src/common/paws/pawswidget.cpp 2012-04-17 07:57:04 UTC (rev 8217) @@ -511,7 +511,7 @@ fontName = fontAttribute->GetAttributeValue("name"); // Check if it's a short definition - if(!fontName.StartsWith("/")) + if(!fontName.StartsWith("/") && fontName.Length()) { fontName = PawsManager::GetSingleton().GetLocalization()->FindLocalizedFile("data/ttf/" + fontName); } @@ -523,11 +523,14 @@ if ( this->resizeToScreen && scaleToScreen ) fontSize *= PawsManager::GetSingleton().GetFontFactor(); - myFont = graphics2D->GetFontServer()->LoadFont(fontName, (fontSize)?fontSize:10); - if ( !myFont ) + if(fontName.Length()) { - Error2("Could not load font: >%s<", (const char*)fontName ); - return false; + myFont = graphics2D->GetFontServer()->LoadFont(fontName, (fontSize)?fontSize:10); + if (!myFont) + { + Error2("Could not load font: >%s<", (const char*)fontName ); + return false; + } } int r = fontAttribute->GetAttributeValueAsInt( "r" ); int g = fontAttribute->GetAttributeValueAsInt( "g" ); @@ -549,7 +552,7 @@ if (fontAttribute->GetAttributeValueAsBool("bold")) fontStyle |= FONT_STYLE_BOLD; } - +out: // Get the frame for this widget. csRef<iDocumentNode> frameNode = node->GetNode("frame"); if ( frameNode ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wel...@us...> - 2012-04-17 07:57:31
|
Revision: 8218 http://planeshift.svn.sourceforge.net/planeshift/?rev=8218&view=rev Author: weltall2 Date: 2012-04-17 07:57:25 +0000 (Tue, 17 Apr 2012) Log Message: ----------- removed goto target Modified Paths: -------------- trunk/src/common/paws/pawswidget.cpp Modified: trunk/src/common/paws/pawswidget.cpp =================================================================== --- trunk/src/common/paws/pawswidget.cpp 2012-04-17 07:57:04 UTC (rev 8217) +++ trunk/src/common/paws/pawswidget.cpp 2012-04-17 07:57:25 UTC (rev 8218) @@ -552,7 +552,7 @@ if (fontAttribute->GetAttributeValueAsBool("bold")) fontStyle |= FONT_STYLE_BOLD; } -out: + // Get the frame for this widget. csRef<iDocumentNode> frameNode = node->GetNode("frame"); if ( frameNode ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wel...@us...> - 2012-04-22 20:31:19
|
Revision: 8234 http://planeshift.svn.sourceforge.net/planeshift/?rev=8234&view=rev Author: weltall2 Date: 2012-04-22 20:31:13 +0000 (Sun, 22 Apr 2012) Log Message: ----------- removed one spurious line Modified Paths: -------------- trunk/src/common/paws/pawswidget.cpp Modified: trunk/src/common/paws/pawswidget.cpp =================================================================== --- trunk/src/common/paws/pawswidget.cpp 2012-04-20 09:31:22 UTC (rev 8233) +++ trunk/src/common/paws/pawswidget.cpp 2012-04-22 20:31:13 UTC (rev 8234) @@ -519,7 +519,7 @@ if ( this->resizeToScreen && scaleToScreen ) fontSize *= PawsManager::GetSingleton().GetFontFactor(); -graphics2D->GetFontServer()->LoadFont(fontName,(fontSize)?fontSize:10); + if(fontName.Length()) { myFont = graphics2D->GetFontServer()->LoadFont(fontName, (fontSize)?fontSize:10); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wel...@us...> - 2012-04-24 11:03:20
|
Revision: 8240 http://planeshift.svn.sourceforge.net/planeshift/?rev=8240&view=rev Author: weltall2 Date: 2012-04-24 11:03:13 +0000 (Tue, 24 Apr 2012) Log Message: ----------- avoid opening folders Modified Paths: -------------- trunk/src/common/paws/pawswidget.cpp Modified: trunk/src/common/paws/pawswidget.cpp =================================================================== --- trunk/src/common/paws/pawswidget.cpp 2012-04-24 11:02:35 UTC (rev 8239) +++ trunk/src/common/paws/pawswidget.cpp 2012-04-24 11:03:13 UTC (rev 8240) @@ -508,7 +508,7 @@ fontName = fontAttribute->GetAttributeValue("name"); // Check if it's a short definition - if(!fontName.StartsWith("/") /*&& fontName.Length()*/) + if(!fontName.StartsWith("/") && fontName.Length()) { fontName = PawsManager::GetSingleton().GetLocalization()->FindLocalizedFile("data/ttf/" + fontName); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ral...@us...> - 2013-10-20 01:14:37
|
Revision: 8897 http://sourceforge.net/p/planeshift/code/8897 Author: ralphcampbell Date: 2013-10-20 01:14:35 +0000 (Sun, 20 Oct 2013) Log Message: ----------- Don't try to set the masking image to the empty string - avoid the useless error message. Modified Paths: -------------- trunk/src/common/paws/pawswidget.cpp Modified: trunk/src/common/paws/pawswidget.cpp =================================================================== --- trunk/src/common/paws/pawswidget.cpp 2013-10-20 00:31:51 UTC (rev 8896) +++ trunk/src/common/paws/pawswidget.cpp 2013-10-20 01:14:35 UTC (rev 8897) @@ -2880,6 +2880,8 @@ void pawsWidget::SetMaskingImage(const char* image) { + if (image == NULL || *image == '\0') + return; maskImage = PawsManager::GetSingleton().GetTextureManager()->GetPawsImage(image); if (!maskImage) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ral...@us...> - 2013-10-21 04:58:45
|
Revision: 8902 http://sourceforge.net/p/planeshift/code/8902 Author: ralphcampbell Date: 2013-10-21 04:58:40 +0000 (Mon, 21 Oct 2013) Log Message: ----------- Remove debug printfs, clear maskingImage if set to empty string, clear parent pointer when removing child. Modified Paths: -------------- trunk/src/common/paws/pawswidget.cpp Modified: trunk/src/common/paws/pawswidget.cpp =================================================================== --- trunk/src/common/paws/pawswidget.cpp 2013-10-20 16:28:12 UTC (rev 8901) +++ trunk/src/common/paws/pawswidget.cpp 2013-10-21 04:58:40 UTC (rev 8902) @@ -392,7 +392,8 @@ if ( !widget ) return; - children.Delete( widget ); + if (children.Delete(widget)) + widget->SetParent(NULL); } void pawsWidget::DeleteChild( pawsWidget* widget ) @@ -2881,7 +2882,10 @@ void pawsWidget::SetMaskingImage(const char* image) { if (image == NULL || *image == '\0') + { + maskImage = 0; return; + } maskImage = PawsManager::GetSingleton().GetTextureManager()->GetPawsImage(image); if (!maskImage) { @@ -2977,14 +2981,9 @@ { static csString style; - if (name=="ChatWindow") - printf("Finding default style for factory '%s'\n", factoryName); - style = defaultWidgetStyles.Get(factoryName,csString("not found")); if (style == "not found" && parent != NULL) { - if (name=="ChatWindow") - printf("No default style found for factory '%s'. Checking parent.\n", factoryName); // walk up the chain of parents return parent->FindDefaultWidgetStyle(factoryName); } @@ -2992,8 +2991,6 @@ return NULL; else { - if (name=="ChatWindow") - printf("Default style '%s' found for factory '%s'\n", style.GetData(), factoryName); return style; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jo...@us...> - 2013-12-29 22:37:29
|
Revision: 9129 http://sourceforge.net/p/planeshift/code/9129 Author: joelyon Date: 2013-12-29 22:37:26 +0000 (Sun, 29 Dec 2013) Log Message: ----------- Fix for defect 6283 : Changed pawsWidget::SetMaskingImage to use 'GetOrAddPawsImage' so that if an image wasn't already loaded into the art cache it would be. Then it can be referred to with or without the path. verified that this works correctly in test. Modified Paths: -------------- trunk/src/common/paws/pawswidget.cpp Modified: trunk/src/common/paws/pawswidget.cpp =================================================================== --- trunk/src/common/paws/pawswidget.cpp 2013-12-29 22:06:41 UTC (rev 9128) +++ trunk/src/common/paws/pawswidget.cpp 2013-12-29 22:37:26 UTC (rev 9129) @@ -2897,7 +2897,8 @@ maskImage = 0; return; } - maskImage = PawsManager::GetSingleton().GetTextureManager()->GetPawsImage(image); + maskImage = PawsManager::GetSingleton().GetTextureManager()->GetOrAddPawsImage(image); + if(!maskImage) { Warning3(LOG_PAWS, "Could not locate masking image %s for widget %s",image,GetName()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |