Next, the LoseFocus event for the RTE...
STRING ls_RTF
GraphicObject objControl
objControl = GetFocus()
IF (NOT ISVALID(objControl)) THEN
RETURN 0
END IF
IF (TypeOf(objControl) = RichTextEdit!) THEN
RETURN 0
END IF
// Prevent screen flicker...
rte_1.SetRedraw(FALSE)
rte_1.SelectTextAll()
ls_RTF = rte_1.CopyRTF()
dw_1.Object.txt_rtf[1] = ls_RTF
rte_1.SelectText(0,0,0,0)
rte_1.SetRedraw(TRUE)
And finally, I created a Save button with the following
code:
dw_1.Update()
What happens is as follows:
1. At first, I tried to open a word document with a picture
in it and hit Control-A to select the entire word document,
then pasted it into the RTE. Everything pasted just fine
except the image. Only got a skeleton box instead. The users
are really going to want this Copy/Paste to work with the
graphics.
2. Upon right-clicking the RTE and selecting "Insert File",
I was able to open that very same document, and it DID
display the picture properly. I was able to click save, and
it seems to have saved it properly to the database. I ran an
SQL statement to look at the DATALENGTH(txt_rtf), and it
reported 476312 bytes, so I think the entire thing did save
to SQL Server. However, when I open up the window again to
try and re-load the document from SQL Server, it just does
not display anything. No error message either.
3. The statements above that read rte_1.SelectText(0,0,0,0)
do not seem to be working, as the entire document remains
selected even after the script runs.
4. I've turned on the toolbar, but I don't see any Font
Color Picker in the toolbar at the top.
Any help would be much appreciated. I'm excited about this
new RTE control, but want to make sure I'm taking the right
approach to doing this.
Thanks!
=Steve=
The Retrieve() method is returning 1 (no error happening
there). However, when I step through the code in the
debugger and inspect the contents of ls_RTF that is fetched
out of the datawindow, the entire RTF text was not present.
I went ahead and copied it to the clipboard and pasted the
partial RTF text into my UltraEdit editor and saved the
file. Guess what the size of the file is? Sure enough, 32K.
So the issue of PowerBuilder assigning the char(32766) size
for the TXT_RTF column is killing this whole thing, I think.
Any ideas?
=Steve=
To get around this you will have to use the SELECTBLOB and UPDATEBLOB
commands to retrieve and save data to your database.
Brad
--
Join the Advanced GUI Development project on CodeXchange
https://advanced-gui-development.codexchange.sybase.com/
As for your first issue, I can't reproduce it. I selected an image from
a word document, copied it then pasted it into my RTE just fine. But, I
do remember seeing this problem once before (with the InsertDocument
function). The image was resized to display smaller in Word but in
reality it's dimesions were really large. The image your pasting into
the RTE may not be scaling down like it does in word. I bet you would
see differenct results if you inserted a small picture into word (do not
size it), then copy and paste it into your RTE. If this is truly the
case, you will need to open a case with Sybase so they can open a case
with the RTE people.
Brad
The simple thing to do would be to edit the source for the datawindow, and
set the column width to 100000... or what works for you.
Brad's suggestion is a better solution, but not without potential challenges
as well.
Regards,
Mike Niemann, PBBrowser Author
<Steve> wrote in message news:45f86338.356...@sybase.com...
"Brad Wery[TeamSybase]" <bradweryatagricoreunited.com> wrote in message
news:45f97f95$1@forums-1-dub...