1. Miguel Leeuwe
  2. PowerBuilder
  3. Friday, 11 August 2023 18:47 PM UTC

Hi,

I discovered that when using V.28.0 of the TEXT Richtext control, our papersizewidth setting was no longer working correctly, but only when using PFCs.

I made a sample PFC application and discovered that I ONLY have the problem with the V28.0, when I do a POST opensheet(....) from the open event of the mdi frame window. (our real application opens the rte containing window from a menu, this is just a quick test app). So that made me wonder WHAT is not initialized in the PFC classes when I don't use POST?

I finally figured out what was wrong: - We have a little rtf formatted text saved in the database and assign that in the richtext's constructor. - It serves the goal of being able to set a default font and fontsize, since none of the supposed functions / properties work for rich text. (at least sofar). - that text was last saved using the V.15.x text control. - Commenting out the assignment of the default font in the constructor has made everything work fine now. - I'll try to see if by recording the new default font using v.28.0 things will work again for v.28's default font assignment.

So if anyone is doing something similar to set a default font for the default font of rich text controls ... Beware you have to record the rtf text newly, using the v.28.0 version of rich text.

enjoy your weekends

MiguelL

 

(keep reading, this is not the only problem with v28.0)

Accepted Answer
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Monday, 14 August 2023 16:36 PM UTC
  2. PowerBuilder
  3. # Permalink

Workaround works:

Instead of ClearAll(), I do:

// of_clearAll()
// -------------
// W1, mjl, 14/08/23:
// The powerbuilder ClearAll() function messes up the paperwidth setting while resizing the control and using v.28.0 for the RTE control 
// This is a workaround:
this.setRedraw(false)
this.selecttextall( Detail!)
this.clear(True )
this.setRedraw(true)

For the similar problem of passing a TRUE value to InsertDocument(..... true ....), we simply don't pass TRUE and instead, call our personalized of_clearAll() right before the InsertDocument() passing in FALSE.

Bug reported, so I'm closing this one.

regards.

Comment
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Tuesday, 12 September 2023 12:08 PM UTC
  2. PowerBuilder
  3. # 1

BTW: solved by the latest hotfix of Appeon for pb 2022.

 

Comment
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Monday, 14 August 2023 01:52 AM UTC
  2. PowerBuilder
  3. # 2

Okay, so I converted my default font rtf text to be generated from a V. 28.0 RTE, and I'm still having problems.

The ClearAll() function is what really makes the adjustment of paperwidth to stop working.
I believe that the InsertDocument() for inserting an html file with parameter TRUE (to clear the contents) also 
has the same problem as ClearAll().
Please see the attached ZIP file with a video and sample application used in the video. (PB 2019 R3).
I've got a ticket https://www.appeon.com/standardsupport/search/view?id=10650 so hopefully it will
be worked out some day.

I'll just have to keep using v 15.0 and won't be able to migrate to PB 2022 until this has been fixed or until the
webview2 control is good enough to work with a tinyMC Editor. (which is not the case yet I believe).

Or maybe I'll try to create my own ClearAll() function. V28 did fix some problems with images when
saving as html I seem to remember.

Just FYI.
regards,
MiguelL
Attachments (1)
Comment
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Friday, 11 August 2023 19:34 PM UTC
  2. PowerBuilder
  3. # 3

It also seems that all of this code in the resize() (pbm_size) event is no longer needed?

// Arthur Hefti's code:
integer li_PixelPerInchX
long LOGPIXELSX = 88
string ls_Null
ulong lul_HDC

SetNull( ls_Null)
lul_HDC = CreateDC("DISPLAY", "", ls_Null, ls_Null) 
li_PixelPerInchX = GetDeviceCaps(lul_HDC, LOGPIXELSX)
DeleteDC(lul_HDC)


// v3, mjl, 28/05/21: added code to make it also work on US windows configuration which is in inches, not centimeters.
// Dan Cooperstock's code:
string ls_measure
long ll_paperWidth
double ldbl_centimeterMultiplier = 2.54

if RegistryGet("HKEY_CURRENT_USER\Control Panel\International", "iMeasure", REF ls_measure) = 1 then
	if ls_measure = "1" /* US, so inches */ then 
		ldbl_centimeterMultiplier = 1
	end if
end if

// at the end we subtract a value because we show a V-Scrollbar, if not that wouldn't be necessary:
// this.paperwidth = (UnitsToPixels( newwidth, XUnitstoPixels! ) / li_PixelPerInchX * 2.54 * 1000) - 650

this.paperwidth = (UnitsToPixels( newwidth, XUnitstoPixels! ) / li_PixelPerInchX * ldbl_centimeterMultiplier * 1000) - (256 * ldbl_centimeterMultiplier)

I'll do some thorough testing this weekend and let you know if code like this is still needed. (in older versions it was needed because it seems that wordwrap was being ignored in certain versions. I could hower, no longer see it fail in the latest V15 and V28 RTE controls).

So that's another thing on my todo list.

regards

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.