Recent

Author Topic: TATTabs and Modified status  (Read 389 times)

Mastropiero

  • New Member
  • *
  • Posts: 29
TATTabs and Modified status
« on: March 17, 2025, 02:13:03 pm »
Hello,

I am dealing with status and saving of documents attached to TTabData objects but can't understand exactly how it works. I haven't found too much documentation either.

I have some questions:

* What is the difference between: TabModified, TabModified2, TabExtModified, TabExtModified2 ?
* Can the 'modified' symbol be placed or spaced properly? It always appears in the middle of the tab, above the caption. I've only been able to change the circle's size, but not its position.
* When I create a new tab, I set TabModified to True and it effectively draws the "modified" circle and changes the caption's colour as specified in the properties. However, after saving the document, I set TabModified to False but it remains the same ('modified' colour and symbol). What am I doing wrong?
* What's the proper way to use the 'modified' properties in conjuction with CanClose, CanContinue parameters on the OnTabClose event? Can anyone point to a good example of this?

Sorry for the bunch of questions but I can't find any docs or references to this on the forum.

Thank you for your help.

AlexTP

  • Hero Member
  • *****
  • Posts: 2557
    • UVviewsoft
Re: TATTabs and Modified status
« Reply #1 on: March 17, 2025, 03:07:35 pm »
Quote
>What is the difference between: TabModified, TabModified2, TabExtModified, TabExtModified2 ?
Simple app needs only TabModified - tab object is modified.
TabModified2 is for CudaText - paired editor (embedded with the main editor into the same tab) is modified.

TabExt* - are for CudaText - means 'file was modified from external program'.


Quote
>Can the 'modified' symbol be placed or spaced properly? It always appears in the middle of the tab, above the caption.

It cannot be changed yet. Noone wanted to change it (even users of CudaText).

Quote
> after saving the document, I set TabModified to False but it remains the same
Can you give the small sample project to show this?
Maybe app did not call Invalidate after setting the prop.


Quote
>What's the proper way to use the 'modified' properties in conjuction with CanClose, CanContinue parameters
These are independent things. Not connected.

Mastropiero

  • New Member
  • *
  • Posts: 29
Re: TATTabs and Modified status
« Reply #2 on: March 17, 2025, 03:24:42 pm »
Simple app needs only TabModified - tab object is modified.
TabModified2 is for CudaText - paired editor (embedded with the main editor into the same tab) is modified.

TabExt* - are for CudaText - means 'file was modified from external program'.

Thank you!   It makes sense now.


Quote
>
It cannot be changed yet. Noone wanted to change it (even users of CudaText).


Ok. Not a big deal. I can handle it manually if necessary.

Quote
Can you give the small sample project to show this?
Maybe app did not call Invalidate after setting the prop.

Excellent, it was the missing Invalidate. It works perfectly now.

Quote
>What's the proper way to use the 'modified' properties in conjuction with CanClose, CanContinue parameters
These are independent things. Not connected.

Yup, I understand they're different things (although they're related from a functional point of view).
Still, are CanContinue and CanClose documented anywhere?  I guess CanClose works the same as as FormClose, but I'm not sure about CanContinue.

Thank you for your help.


AlexTP

  • Hero Member
  • *****
  • Posts: 2557
    • UVviewsoft
Re: TATTabs and Modified status
« Reply #3 on: March 17, 2025, 04:34:48 pm »
I now added comment to the attabs.pas:

    //ACanClose: handler must set to True to allow closing of the current tab.
    //ACanContinue: handler must set to True to allow closing of other tabs, for the mass closing request, eg "Close all tabs".
« Last Edit: March 17, 2025, 04:37:33 pm by AlexTP »

 

TinyPortal © 2005-2018