4D Write Pro using 4D Write-Like Toolbar

2018-06-09 Thread JOHN BAUGHMAN via 4D_Tech
I finally got  this resolved with some help from tech support.

FYI, if you are having trouble getting 4D Write Pro to work in an old database 
form, try replacing the form with a newly created one.

In my case the form was an input form that was probably created in v6 (2003). 
The main issue was that 4D was not recognizing the initialized 4D WRite Pro 
variable as a 4D Write Pro Object. Replacing the existing input form with a 
newly created from fixed the problem. I just copied everything from the not 
working form to the new form and it worked.

 See my original post below for.a more detailed description of the problems I 
ran into.

John

> I am struggling trying to get the 4D Write-Like Toolbar to work…
> 
>   http://download.4d.com/4DBlog/Tips/4DWriteLikeToolbarDemo.zip
> 
> I am trying to create a transition from 4D Write to 4D Write Pro so I have 
> added a second page to the input from and moved the 4D Write area to the this 
> new second page. On the first page I have put the 4D Write Pro area and the 
> Write-Like sub form. To make it simple I have named the 4D Write Pro the same 
> name used in the Write-Like Demo... WP_WriteProArea
> 
> I am working in my templates table. When an existing template record is 
> opened, in the on load event of the input form, I am initializing …
> 
>   C_OBJECT(WP_Information;WP_WriteProArea)
>   WP_WriteProArea:=WP New("") 
>   WP_Information:=New object("IsNewDocument";True)
>   WP_Information.DocumentInfo:=New 
> object("FilePath";"";"Modification";False)
>   FORM GOTO PAGE(2)
> 
> In the demo all of the above is done before the form is opened. When the form 
> is opened in the On Load phase of the main window, the window title is set as 
> is the focus set  to the 4D Write Pro area. Nothing more in the main window. 
> 
> That leaves the sub form On load event. Just to make sure that the subform is 
> working, I would normally to to page 2, but I am leaving the user on page 1 
> and have confirmed that all of the On Load code has run in the subform. At 
> this point the 4D Write Pro area is blank, exactly like it is in the Demo.
> 
> The problem is that unlike the demo, nearly all of the menu items in the 
> subform are disabled. 
> 
> The load document icon works, so I loaded a wp4 document from disk. That 
> worked. If I select some text, then select a font from the font popup list, 
> 4D throws an error on this line…
> 
>   $wpRange:=WP Get selection(WP_WriteProArea)  //“form object not found 
> or form object is not a 4D Write Pro Form Object"
> 
> This is in the method GetSelectionInfo which I have not touched.
> 
> The only difference that I can see between what I have done and what is in 
> the demo is that I have ca;lled WP_WriteProArea:=WP New("") in the on load 
> phase of the input form and the demo calls it before the form is opened. I 
> hope that is not the problem.
> 
> Any help would be greatly appreciated.
> 
> John







John Baughman
1331 Auwaiku Street
Kailua, Hawaii  96734
(808) 262-0328
john...@hawaii.rr.com

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

4D Write Pro using 4D Write-Like Toolbar

2018-06-05 Thread JOHN BAUGHMAN via 4D_Tech
I am struggling trying to get the 4D Write-Like Toolbar to work…

http://download.4d.com/4DBlog/Tips/4DWriteLikeToolbarDemo.zip

I am trying to create a transition from 4D Write to 4D Write Pro so I have 
added a second page to the input from and moved the 4D Write area to the this 
new second page. On the first page I have put the 4D Write Pro area and the 
Write-Like sub form. To make it simple I have named the 4D Write Pro the same 
name used in the Write-Like Demo... WP_WriteProArea

I am working in my templates table. When an existing template record is opened, 
in the on load event of the input form, I am initializing …

C_OBJECT(WP_Information;WP_WriteProArea)
WP_WriteProArea:=WP New("") 
WP_Information:=New object("IsNewDocument";True)
WP_Information.DocumentInfo:=New 
object("FilePath";"";"Modification";False)
FORM GOTO PAGE(2)

In the demo all of the above is done before the form is opened. When the form 
is opened in the On Load phase of the main window, the window title is set as 
is the focus set  to the 4D Write Pro area. Nothing more in the main window. 

That leaves the sub form On load event. Just to make sure that the subform is 
working, I would normally to to page 2, but I am leaving the user on page 1 and 
have confirmed that all of the On Load code has run in the subform. At this 
point the 4D Write Pro area is blank, exactly like it is in the Demo.

The problem is that unlike the demo, nearly all of the menu items in the 
subform are disabled. 

The load document icon works, so I loaded a wp4 document from disk. That 
worked. If I select some text, then select a font from the font popup list, 4D 
throws an error on this line…

$wpRange:=WP Get selection(WP_WriteProArea)  //“form object not found 
or form object is not a 4D Write Pro Form Object"

This is in the method GetSelectionInfo which I have not touched.

The only difference that I can see between what I have done and what is in the 
demo is that I have ca;lled WP_WriteProArea:=WP New("") in the on load phase of 
the input form and the demo calls it before the form is opened. I hope that is 
not the problem.

Any help would be greatly appreciated.

John







John Baughman
1331 Auwaiku Street
Kailua, Hawaii  96734
(808) 262-0328
john...@hawaii.rr.com

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**