Changing The Insert Picture Dialog
-
- Posts: 13
- Joined: Fri Feb 24, 2006 5:48 pm
Changing The Insert Picture Dialog
Hi,
Is there an easy way to change the default insert picture dialog but still using the default insertpicture action, like the colordialog in the control panel.
Also another doubt. By default temporary image files are saved with the "img" prefix. Is there a way to define this prefix or is it by default.
Thanks,
Carlos Castro
Is there an easy way to change the default insert picture dialog but still using the default insertpicture action, like the colordialog in the control panel.
Also another doubt. By default temporary image files are saved with the "img" prefix. Is there a way to define this prefix or is it by default.
Thanks,
Carlos Castro
-
- Site Admin
- Posts: 17522
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
TrvActionInsertPicture is not very complicated.
It displayes a file open dialog, loads the chosen picture (using temporal TPicture object, because it can detect graphic format), then inserts the picture using InsertPicture method.
I think if you need a different dialog, you can create your own action or menu command instead of it.
It displayes a file open dialog, loads the chosen picture (using temporal TPicture object, because it can detect graphic format), then inserts the picture using InsertPicture method.
I think if you need a different dialog, you can create your own action or menu command instead of it.
-
- Posts: 13
- Joined: Fri Feb 24, 2006 5:48 pm
Thanks Sergey,
I doing a new one, which as the ability to resize the image to a predefined maximux width and also has the ability to make simple adjustments like brithness, contrast and intensity.
But for the second part of the question, is there a way to change the "img" prefix, richedit uses to store temporary images.
Thanks,
Carlos Castro
I doing a new one, which as the ability to resize the image to a predefined maximux width and also has the ability to make simple adjustments like brithness, contrast and intensity.
But for the second part of the question, is there a way to change the "img" prefix, richedit uses to store temporary images.
Thanks,
Carlos Castro
-
- Site Admin
- Posts: 17522
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Posts: 13
- Joined: Fri Feb 24, 2006 5:48 pm
-
- Site Admin
- Posts: 17522
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
I am sorry, currently prefixes of text and paragraph styles are hardcoded.
To create one HTML from several documents, you need to create common collections of styles for them.
How to do it
Load the first document (LoadRVFFromStream). You can export it to HTML, but do not save CSS table yet.
Clear.
Load the next document using InsertRVFFromStream. Styles will be not replaced but added.
You can export it to HTML, but do not save CSS table yet.
Clear.
Repeat for all documents. Do not call Format, and this procedure will be fast.
At the end of this step, you have RVStyle containing styles necessary to display all your documents. You can save CSS table now.
To create one HTML from several documents, you need to create common collections of styles for them.
How to do it
Load the first document (LoadRVFFromStream). You can export it to HTML, but do not save CSS table yet.
Clear.
Load the next document using InsertRVFFromStream. Styles will be not replaced but added.
You can export it to HTML, but do not save CSS table yet.
Clear.
Repeat for all documents. Do not call Format, and this procedure will be fast.
At the end of this step, you have RVStyle containing styles necessary to display all your documents. You can save CSS table now.
-
- Posts: 13
- Joined: Fri Feb 24, 2006 5:48 pm
I understand but that solution doesnt fit my needs.
I already managed to work out a solution.
I am working with databases.
I have a database with news posts.
Each record has a text field which holds the html produced by the richview editor.
Then the webserver with php generates a page containing for exemple 10 news posts. That when thing got messy. because each record has the same styles names "rsvtX"
Showing 10 posts in a page produced by php would mess things up.
So what i did was before posting the html code to the database I export it to a stringlist and then use the id of each record and replace the "rsvt" text with someting like "csst1_", where the number 1 corresponds to the id of the record in the database.
The final html code which goes to the text field in the database has styles named like csst1_1, csst1_2 and ccsp1_1, cssp1_2 for the first record in the database.
For the second records it looks like csst2_1, csst2_2 and cssp2_1, cssp2_2.
So i can get as many records i want in an php html produced page that styles never get messed up.
I know html code get a little longer but not that much.
Hope you could understand my explanation as it gets useful for others.
Thanks anyway for your attention,
Regards,
Carlos Castro
I already managed to work out a solution.
I am working with databases.
I have a database with news posts.
Each record has a text field which holds the html produced by the richview editor.
Then the webserver with php generates a page containing for exemple 10 news posts. That when thing got messy. because each record has the same styles names "rsvtX"
Showing 10 posts in a page produced by php would mess things up.
So what i did was before posting the html code to the database I export it to a stringlist and then use the id of each record and replace the "rsvt" text with someting like "csst1_", where the number 1 corresponds to the id of the record in the database.
The final html code which goes to the text field in the database has styles named like csst1_1, csst1_2 and ccsp1_1, cssp1_2 for the first record in the database.
For the second records it looks like csst2_1, csst2_2 and cssp2_1, cssp2_2.
So i can get as many records i want in an php html produced page that styles never get messed up.
I know html code get a little longer but not that much.
Hope you could understand my explanation as it gets useful for others.
Thanks anyway for your attention,
Regards,
Carlos Castro
-
- Posts: 13
- Joined: Fri Feb 24, 2006 5:48 pm
-
- Site Admin
- Posts: 17522
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
1) Only styles that have Standard property = False can be deleted automatically. All styles added on inserting other documents have Standard=False (there was a bug in HTML importer, it added "Standard=True" styles, it was fixes). All styles added as a result of editing operations must have Standard=False (if you use RichViewActions, or your code in OnStyleConversion is based on trichview demos)
2) Unused styles are deleted on document loading.
2) Unused styles are deleted on document loading.