WPCubed Product Support

Creating split screens programatically

Hello,

Trying to create a split screen in code. As a test I've dropped two WPRichText editors on a form, set AllowMultiView to True and then dropped a TWPRTFStorage control and a TButton on the form.

In the button onClick event I add the following code:

RTFStorage.Links.Clear;
  StorageLink := RTFStorage.Links.Add;
  StorageLink.RTFControl := WPRichText1;
  StorageLink.TextName := 'Editor1';  
  StorageLink.DisplayMode := wpDisplayTextStream;

  StorageLink := RTFStorage.Links.Add;
  StorageLink.RTFControl := WPRichText2;
  StorageLink.TextName := 'Editor1';
  StorageLink.DisplayMode := wpDisplayTextStream;

This doesnt work. The second RichText editor stays blank. What am I missing? When I create the links using the Links property editor at design time it works!

Regards,

Paul

#1 ♥ 0
4.7k Views 2 users read 1 min

Hello WpTools,

Forgot to add that I have included the OnInitializeRTFDataObject event and tied the event to the two RichText editors.

if RTFData = nil then begin
  	RTFData := TWPRTFDataCollection.Create(TWPRTFDataBlock);
   	RTFDataProps := TWPRTFProps.Create;
   	RTFData.RTFProps := RTFDataProps;
	end;
	RTFDataObject := RTFData;

Paul

#2 ♥ 0
support

Hi,

did you find the "Mini" demo in Deoms\Tasks?

Please do not use the RTFStorage here - using the OnInitializeRTFDataObject is enough.

Kind Regards,
Julian

#3 ♥ 0
This category is archived. No new posts are possible.