EncyclopediaDetailPanel question
Moderator: Committer
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: EncyclopediaDetailPanel question
Is there a reason to add a separate constructor taking a parameter for the flags, rather than adding a parameter and using a default value equal to the old flags? Would avoid needed to add Init() as well...
Re: EncyclopediaDetailPanel question
Because my C++ is *very* rusty... Here's a new one...
All the patches I'll provide for freeorion will be released under the GPL v2 or later license.
Let's unleash the dyson forest powa!
Let's unleash the dyson forest powa!
Re: EncyclopediaDetailPanel question
I also would like to propose another change to EDP, mainly removing the "static" from m_items & m_items_it, because I see no reason that one EDP change another one's state.
I prefer them to stay away from each other's toes, so that when closing design, prod or research window, the mapwnd's pedia is still on the page it was before toggling those full screen windows.
I prefer them to stay away from each other's toes, so that when closing design, prod or research window, the mapwnd's pedia is still on the page it was before toggling those full screen windows.
All the patches I'll provide for freeorion will be released under the GPL v2 or later license.
Let's unleash the dyson forest powa!
Let's unleash the dyson forest powa!
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: EncyclopediaDetailPanel question
You don't specify default parameters in the constructor declaration.vincele wrote:Here's a new one...
Re: EncyclopediaDetailPanel question
You mean the .h does not need any modification ?
All the patches I'll provide for freeorion will be released under the GPL v2 or later license.
Let's unleash the dyson forest powa!
Let's unleash the dyson forest powa!
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: EncyclopediaDetailPanel question
"don't" meant "didn't"
Your constructor declaration doesn't specify default parameters. The constructor is used elsewhere assuming 2 parameters, but needs 3, because there is no default for the new parameter.
Your constructor declaration doesn't specify default parameters. The constructor is used elsewhere assuming 2 parameters, but needs 3, because there is no default for the new parameter.
Re: EncyclopediaDetailPanel question
like this ?
If not, I clearly don't understand what you're speaking about, sorry...All the patches I'll provide for freeorion will be released under the GPL v2 or later license.
Let's unleash the dyson forest powa!
Let's unleash the dyson forest powa!
- adrian_broher
- Programmer
- Posts: 1156
- Joined: Fri Mar 01, 2013 9:52 am
- Location: Germany
Re: EncyclopediaDetailPanel question
To specify default parameters the declaration needs to define the default parametersvincele wrote:If not, I clearly don't understand what you're speaking about, sorry...
TheClass.h
Code: Select all
#ifndef THECLASS_H
#define THECLASS_H
class TheClass {
public:
TheClass(int param1, int param2 = 2); // param2 has now the default value 2
};
#endif
Code: Select all
#include "TheClass.h"
TheClass::TheClass(int param1, int param2) // the definition doesn't contain the default parameter
{
}
Code: Select all
#include "TheClass.h"
int main(int argc, char** argv)
{
TheClass intstance1(5); // a instance with param2 = 2 is created;
TheClass instance2(5, 3); // this instance has param2 with the value 3;
}
Resident code gremlin
Attached patches are released under GPL 2.0 or later.
Git author: Marcel Metz
Attached patches are released under GPL 2.0 or later.
Git author: Marcel Metz
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: EncyclopediaDetailPanel question
That patch builds and runs, and hides the X on the design screen, but it didn't deal with the research and production screens with the same issue...
Re: EncyclopediaDetailPanel question
I know the code for prod & research didn't have anything but I don't see the X button on those EDPs so I didn't fix the non-problem, I did the minimal fix... Do you see an X button on those ? As I'm not seeing any close buttons on those I won't be able to test the additional changes...Geoff the Medio wrote:That patch builds and runs, and hides the X on the design screen, but it didn't deal with the research and production screens with the same issue...
Here is the updated patch... Thanks Adrian for the perfect explanations.
All the patches I'll provide for freeorion will be released under the GPL v2 or later license.
Let's unleash the dyson forest powa!
Let's unleash the dyson forest powa!
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: EncyclopediaDetailPanel question
Try dragging the research and production pedia panels around. For some reason the X doesn't appear until they're moved for me...
Re: EncyclopediaDetailPanel question
Indeed, the button appeared after wnd move, and the latest patch fixes that.Geoff the Medio wrote:Try dragging the research and production pedia panels around. For some reason the X doesn't appear until they're moved for me...
Any thoughts about the static-ectomy patch ?
All the patches I'll provide for freeorion will be released under the GPL v2 or later license.
Let's unleash the dyson forest powa!
Let's unleash the dyson forest powa!
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: EncyclopediaDetailPanel question
Committed the button patch... https://sourceforge.net/p/freeorion/code/7303/
Re: EncyclopediaDetailPanel question
Thanks a lot for the mentoring.
Let me know what you think about the idea of removing the static, there's no rush though.
Let me know what you think about the idea of removing the static, there's no rush though.
All the patches I'll provide for freeorion will be released under the GPL v2 or later license.
Let's unleash the dyson forest powa!
Let's unleash the dyson forest powa!