Author Topic: SetEditorTitle() and modified files  (Read 2849 times)

Offline artoj

  • Almost regular
  • **
  • Posts: 206
  • Location: Supporting my team
    • http://ajonsson.kapsi.fi/
SetEditorTitle() and modified files
« on: October 03, 2006, 08:37:37 pm »
Hi,

I'm using the SetEditorTitle() function to set a more descriptive title to my editor tab; I'm creating a temporary file and the file name is usually something like "389fk3.tmp". Everything works ok until I edit the file and C::B puts the "*" mark and changes the tab's title to the original, i.e. ugly file name "389fk3.tmp".

Is there any way to get around this?

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Re: SetEditorTitle() and modified files
« Reply #1 on: October 03, 2006, 11:04:29 pm »
As a workaround, tried calling SetModified(true) before calling SetTitle()?
Be patient!
This bug will be fixed soon...

Offline artoj

  • Almost regular
  • **
  • Posts: 206
  • Location: Supporting my team
    • http://ajonsson.kapsi.fi/
Re: SetEditorTitle() and modified files
« Reply #2 on: October 04, 2006, 09:53:22 am »
As a workaround, tried calling SetModified(true) before calling SetTitle()?

Nope, doesn't work. When I try to edit the file it restores the ugly file name again.

I could of course set the better title every time EVT_EDITOR_MODIFIED fires but I think it's an ugly way to do it.

The trouble function is in cbeditor.cpp, SetModified() @ 527. It always uses the m_Shortname when restoring the tab's title.