Pretty printing library

Cableguy

Expert
Licensed User
Longtime User
Not sure if this has been adressed or not, but her it goes...

I have 2 forms, one is defined as aFormEx control, inherited from a b4p standart form...And is MDI Parent enabled...

MainFormEx.IsMDIparent=True


The other is the MDIChild form, properly referenced with

MainFormEx.MakeMDIchild("Form2")

Now my questions are:
1-How to alway show the MDIChild form in "FullScreen", thus being maximized within the Parent Screen Area.

2-Whenever I close the CHILD form, the app also closes...To my knowleage, this is not the normal behaviour of a child...
 

agraham

Expert
Licensed User
Longtime User
1-How to alway show the MDIChild form in "FullScreen", thus being maximized within the Parent Screen Area.
I haven't tried this but you should be able to set the WindowState property with the Door library

Obj1.Value = FormExChild.ControlRef
Obj1.SetProperty("WindowState", "Maximized") ' Note the American spelling of Maximised
or
Obj1.SetProperty("WindowState", 2)


2-Whenever I close the CHILD form, the app also closes...To my knowleage, this is not the normal behaviour of a child...
Use a FormEx for the Child, not a Form. From the help for FormEx.Run

"FormEx.Run will display the extended form as the main form and close the application when it is closed. Do not use native Basic4ppc (non-extended) forms in the application as Basic4ppc will think that the first one of them shown is the main form and will close the application if that form is closed."
 

Cableguy

Expert
Licensed User
Longtime User
First I must appologise, i posted in the wrong dll thread, This shouyld have gone to the FormExDesktop thread...

I have solved both my problems, thanks to Agraham...

The 1st was solved by making my form2 a FormExDessktop control, and pass its ref to the "Main" FormExDesktop, thus making it the parent...

To solve the 2nd, Agraham sugested....

I haven't tried this but you should be able to set the WindowState property with the Door library

Obj1.Value = FormExChild.ControlRef
Obj1.SetProperty("WindowState", "Maximized") ' Note the American spelling of Maximised
or
Obj1.SetProperty("WindowState", 2)

Well, after some thought, I tryed the already existing "WindowState" property from FormExDesktop, and set it to 2, and it worked, no Door dll needed..

Thanks Andrew, keep up with the excellent work...and don't forget to vote for the Member EREL to get he's medal!!!
 
Last edited:

agraham

Expert
Licensed User
Longtime User
Version 1.8 now posted. At Cableguy's request this allows user editing and formatting of text.

Added SelectedRtf, SelectedText, SelectionFont, SelectionStart and SelectionLength properties. All formatting properties, Alignment, Bold, Color etc. are now assignable to selections.

Added GetSelectionFormat method. You need to use this when editing a selection to retrieve the present font attributes of the selection otherwise the most recently used font attributes will all be assigned to the selection when you change any of its attributes.

Added FontDialog.FontRef to retrieve a Font reference. You could use this with ImageLibEx or the SelectionFont property above.

Removed FontScript as it was doing nothing anyway.
 

Cableguy

Expert
Licensed User
Longtime User
Version 1.8 now posted. At Cableguy's request this allows user editing and formatting of text.

Added SelectedRtf, SelectedText, SelectionFont, SelectionStart and SelectionLength properties. All formatting properties, Alignment, Bold, Color etc. are now assignable to selections.

Added GetSelectionFormat method. You need to use this when editing a selection to retrieve the present font attributes of the selection otherwise the most recently used font attributes will all be assigned to the selection when you change any of its attributes.

Added FontDialog.FontRef to retrieve a Font reference. You could use this with ImageLibEx or the SelectionFont property above.

Removed FontScript as it was doing nothing anyway.


You are amazing, Thank you very much...
Just a minor issue, the example file is un-touched, and still includes the fontscript propertie...

PS. I was the one to request it, but I'm sure other had already wondered about these features, right?
 
Last edited:

mjcoon

Well-Known Member
Licensed User
I did modify it but missed one :(. Fixed now.

Hi Andrew, I am just making a first attempt to use this feature. I copied the demo html file and gif to my AppPath but am getting (under desktop IDE) a pop-up saying that my HtmlPanel1.ShowHtmlFile(html) fails "Parameter not valid".

Is there any way that I can get a more specific error diagnostic, or is there a most likely reason?

Since my program is desktop only I have a much bigger panel and have omitted the attribute settings that are in the demo (since none looked mandatory and would not be what I eventually want).

Any hints, please?

Cheers, TIA, Mike.
 
Top