hi, i need to save a runtime created style to an ini file.
my style has 3 textstyles and 3 parastyles (used for alignment), and i save it with:
StileRich->SaveINI(filename,index);
but it save all 3 textstyles, but noone parastyles.
and also...what should the index value be?
thanks and bye
[Help] Save style to ini file
-
- Site Admin
- Posts: 17566
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
I cannot reproduce this problem.
For example, I saved RVStyle from RichViewActions demo, and it worked fine. The saved ini-file contains the line
and a number Para*=* lines.
Note that only properties with changed (not default) values are saved.
For example, I saved RVStyle from RichViewActions demo, and it worked fine. The saved ini-file contains the line
Code: Select all
ParasCount=3
Note that only properties with changed (not default) values are saved.
-
- Site Admin
- Posts: 17566
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
I uses RichViewActions only because it's easy to test.
Ok, I created a new document in RichViewActions (one text and one paragraph style by default), added a text line, centered it (so the second, centered, paragraph style is added).
Saved to ini-file.
The following Para* lines are saved:
As you can see, two paragraph styles are saved. Both have name "Left" (because when RichViewActions creates a new style, it names it by its parent style), and you can see "ParaAlignment1=2" line, telling that the alignment of ParaStyles[1] is centered.
All as expected.
Ok, I created a new document in RichViewActions (one text and one paragraph style by default), added a text line, centered it (so the second, centered, paragraph style is added).
Saved to ini-file.
The following Para* lines are saved:
Code: Select all
ParasCount=2
ParaStyleName0=Left
ParaStyleName1=Left
ParaStandard1=0
ParaAlignment1=2
All as expected.
-
- Site Admin
- Posts: 17566
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Collections of TextStyles and ParaStyles are special.
When accessing an out of bounds item, TextStyles.InvalidItem/ParaStyles.InvalidItem is returned, instead of raising an exception.
By default, TextStyles.InvalidStyles is white on red text, ParaStyles.InvalidItem has a red border.
It was implemented in this way because it's usually simpler to find an error in document generation if incorrect text is displayed in red than if the component generates an exception on formatting/drawing.
When accessing an out of bounds item, TextStyles.InvalidItem/ParaStyles.InvalidItem is returned, instead of raising an exception.
By default, TextStyles.InvalidStyles is white on red text, ParaStyles.InvalidItem has a red border.
It was implemented in this way because it's usually simpler to find an error in document generation if incorrect text is displayed in red than if the component generates an exception on formatting/drawing.
Last edited by Sergey Tkachenko on Sat Mar 11, 2006 5:37 pm, edited 1 time in total.