updating the dialog gui

Everything about development and the OpenMW source code.
Post Reply
User avatar
artorius
Posts: 46
Joined: 08 Mar 2012, 13:59
Location: VA, USA

updating the dialog gui

Post by artorius »

So, I've been trying my hand at updating the dialog gui to make it look more like vanilla Morrowind. Just about everything is working good so far, all of the widgets are in closer positions as they are in vanilla Morrowind, and you can resize and move the window. Also, I have added the transparent background.

However, I'm having troubles with this bit:

Code: Select all

<Widget type="Window" skin="MW_Window" layer="Windows" position="0 0 588 275" name="_Main">
	<!-- HEADER -->
	<Widget type="TextBox" skin="MW_Caption" position="0 0 588 18" name="NpcName" align="ALIGN_LEFT ALIGN_TOP">
            <Property key="Caption" value="Name"/>
	    <Property key="TextAlign" value="ALIGN_CENTER"/>
	  </Widget>
This is in the openmw_dialog_window_layout.xml file. The problem that I am having is that the NPC's name is right below the window border. See the pic below.
screenshot003.jpg
So, I'm trying to figure out how to combine the NpcName widget to actually display the name of the NPC in the window title. Any advice? I'm not a MyGUI guru, I just figured this out by playing around with the XML files.
User avatar
scrawl
Posts: 2152
Joined: 18 Feb 2012, 11:51

Re: updating the dialog gui

Post by scrawl »

set the window title like this:

static_cast<MyGUI::Window*>(mMainWidget)->setCaption("TITLE");

in openengine/gui/layouts.hpp there is also a method that adjusts the title bar size, you should call it after changing the title
User avatar
artorius
Posts: 46
Joined: 08 Mar 2012, 13:59
Location: VA, USA

Re: updating the dialog gui

Post by artorius »

scrawl wrote:set the window title like this:

static_cast<MyGUI::Window*>(mMainWidget)->setCaption("TITLE");

in openengine/gui/layouts.hpp there is also a method that adjusts the title bar size, you should call it after changing the title
I'm probably going to need your help with that part, I am by no means a programmer, I was trying to see what I could do with the XML files since I can understand those.

I found this on line115 in layout.hpp, is that where I need to modify it to reflect what you posted?
User avatar
scrawl
Posts: 2152
Joined: 18 Feb 2012, 11:51

Re: updating the dialog gui

Post by scrawl »

I found this on line115 in layout.hpp, is that where I need to modify it to reflect what you posted?
The Dialog window is derived from OEngine::Gui::Layout, thus you can just call that method from the Dialog window class.

this would be the new code to change the window caption:

Code: Select all

static_cast<MyGUI::Window*>(mMainWidget)->setCaption("TITLE");
adjustWindowCaption();
Post Reply