Author Topic: Small error in projectmanagerui  (Read 460 times)

Offline gd_on

  • Regular
  • ***
  • Posts: 452
Small error in projectmanagerui
« on: January 28, 2019, 04:33:21 pm »
When an opened project is modified outside C::B a warning message is displayed. But the text displayed is only "Project", no name, ...
This is done at line 2700 in projectmanagerui.cpp. If I replace prj->GetFilename().c_str() by prj->GetTitle().wx_str(), the message is better, giving now the correct name. Nevertheless, it's not enough because the message has 2 lines (the second one add information for the action to be done), and only one is displayed. I don't know where to modify this !

gd_on
« Last Edit: January 28, 2019, 05:45:02 pm by gd_on »
Windows 10 or 7, svn C::B (last version or almost!), WxWidgets 2.8.12, Compilers TDM 4.9.2 32 bits (gcc and gfortran installed in C:\MinGW32). Tests with C::B 64 bits and WxWidgets 2.8.12 or 3.1.2 (64 bits) compiled by TDM 4.9.2 or Std 8.1 in C:\MinGW64

Offline Miguel Gimenez

  • Regular
  • ***
  • Posts: 281
Re: Small error in projectmanagerui
« Reply #1 on: January 28, 2019, 05:27:37 pm »
The dialog uses a wxStaticLabel, but this control does not recognize LF as a line breaker. It can be forced to wrap when a given width is exceded; to get this you must call the Wrap method of the control.

You can test modifying the code in confirmreplacedlg.cpp:38 from

Code: [Select]
    XRCCTRL(*this, "lblMessage", wxStaticText)->SetLabel(label);
    this->SetEscapeId(XRCID("btnCancel"));

to (untested)

Code: [Select]
    XRCCTRL(*this, "lblMessage", wxStaticText)->SetLabel(label);
    XRCCTRL(*this, "lblMessage", wxStaticText)->Wrap((GetWidth()*9)/10);
    this->SetEscapeId(XRCID("btnCancel"));

Offline gd_on

  • Regular
  • ***
  • Posts: 452
Re: Small error in projectmanagerui
« Reply #2 on: January 28, 2019, 07:09:28 pm »
Tested but it does not work.
First, the GetWidth is not seen (declared out of the scope). Compiler suggests to use GetMinWidth.
I tried like that, but even with a full rebuild (because I think it affects sdk), I see only the first line.
I have also tried to delete the \n in the string, but the line is now truncated and the end of the string is missing. :(

gd_on
« Last Edit: January 28, 2019, 07:41:09 pm by gd_on »
Windows 10 or 7, svn C::B (last version or almost!), WxWidgets 2.8.12, Compilers TDM 4.9.2 32 bits (gcc and gfortran installed in C:\MinGW32). Tests with C::B 64 bits and WxWidgets 2.8.12 or 3.1.2 (64 bits) compiled by TDM 4.9.2 or Std 8.1 in C:\MinGW64

Offline Miguel Gimenez

  • Regular
  • ***
  • Posts: 281
Re: Small error in projectmanagerui
« Reply #3 on: January 28, 2019, 07:16:49 pm »
Sorry. The width value should be get using

Code: [Select]
int Width, Height;
GetClientSize(&Width, &Height);

May be the sizer doesn't let the label grow vertically.