Sign in to follow this  
Followers 0
longtex

Rich Text Control - write a EULA

9 posts in this topic

#1 ·  Posted (edited)

Rich Text Control - write a EULA

See also Word Automation LIb thread in Example Scripts

http://www.autoitscript.com/forum/index.ph...0461&st=105

I'm trying to do a fairly basic EULA-type thing for the local Public Library. Maybe I'm going about it the wrong way, but it seemed like a good idea when I jumped in... the idea is that the user runs it instead of IE or FF, and if he agrees, then it runs IE or FF, otherwise... sorry, citizen: of COURSE you have a right to use public facilities, but unless you agree to be fingerprinted, photographed, and searched, we can't let you in.

I've been pointed at what appears to be pretty dang close... the example in guictrlcreateedit() doc, which shows a rich text edit box (although it's a write, not a read)... I jumped through a couple of hoops and got MSCOMCT2.OCX properly installed, and tracked down a fix for a registry problem (see the Example Scripts thread), and the example now runs.

Hopefully, the only other big hoop I need to jump through is getting the text from the .doc file into the text object, instead of hard-coded text, but I haven't been able to make that happen - It looks like there should be a ReadFile() function - oh, sorry, uhhhh... method? - in the richtext control, but I haven't been able to track down the docs on it... even then... it remains to be seen if it'll work, but that's the next step.

If you can point me at the ReadFile() docs or if you have a better idea on the Eula... anyone?

Edited by longtex

Nobody needs a job. Not much, anyway. Before you need a job, there's a lot of other stuff you need. More or less in order of how badly you need them: AIR, WATER, FOOD, SHELTER, CLOTHING, COMPANIONSHIP, and ACTIVITY. You've been led to believe you need money to "pay" someone else to provide those for you - all but AIR, so far. How long is it going to be before you have to "pay" for AIR, too?

Share this post


Link to post
Share on other sites



Hello,

you could embed an IE html control into a gui window,

enabling you to use html features like font, img and so on.

If you already have the doc file, you can export it to ugly html,

but a well looking page.

There are numerous examples at the forum, just search for them.

ciao

Xandl

Share this post


Link to post
Share on other sites

Hallo Longtex

Maybe I don't get it right but the Richtext example refers to Richtext.Richtextctrl component and that can be read / write

and there is a loadfile function as savefile.

.text function display/return Rich as formatted text while .RichRtf display/return the compleate source - one can translate inbetween formats with these two commands. There is a lot of Rich components around target to different OS and with special features...

kjactive

Share this post


Link to post
Share on other sites

Hallo Longtex

Maybe I don't get it right but the Richtext example refers to Richtext.Richtextctrl component and that can be read / write

and there is a loadfile function as savefile.

.text function display/return Rich as formatted text while .RichRtf display/return the compleate source - one can translate inbetween formats with these two commands. There is a lot of Rich components around target to different OS and with special features...

kjactive

You're right - it refers to Richtext.Richtextctrl, but I can't find doc on it. I guessed a ".ReadFile" method existed, and it didn't say "No", but it didn't like the file name for some reason. I'll try ".LoadFile" and see if that's any better... but I still don't know where to find the actual doc that describes all the methods and properties - can you point me to it?

To elucidate: yes, there is an existing .doc file. All I want to do is display it, along with a couple of buttons labeled "Yes/No" or "accept/Decline" or whatever, and then act appropriately on the response. The document is clearly going to be like all the other (*&#@$ EULA's in the world, that is, extremely long, so it will need to be displayed with sliders...

Thanks!


Nobody needs a job. Not much, anyway. Before you need a job, there's a lot of other stuff you need. More or less in order of how badly you need them: AIR, WATER, FOOD, SHELTER, CLOTHING, COMPANIONSHIP, and ACTIVITY. You've been led to believe you need money to "pay" someone else to provide those for you - all but AIR, so far. How long is it going to be before you have to "pay" for AIR, too?

Share this post


Link to post
Share on other sites

You're right - it refers to Richtext.Richtextctrl, but I can't find doc on it. I guessed a ".ReadFile" method existed, and it didn't say "No", but it didn't like the file name for some reason. I'll try ".LoadFile" and see if that's any better... but I still don't know where to find the actual doc that describes all the methods and properties - can you point me to it?

To elucidate: yes, there is an existing .doc file. All I want to do is display it, along with a couple of buttons labeled "Yes/No" or "accept/Decline" or whatever, and then act appropriately on the response. The document is clearly going to be like all the other (*&#@$ EULA's in the world, that is, extremely long, so it will need to be displayed with sliders...

Thanks!

I was trying
.text=$oRP.ReadFile("filename.doc")
, which gave an error. I changed it to
.text=$oRP.LoadFile("filename.doc")
, which didn't give an error, but left the text blank. I changed that to just
$oRP.LoaadFile("filename.doc")
, which sort of worked. I say "sort of" because while it DID load the contents into the display, it not only isn't formatted, it is full of garbage characters, just as if you loaded it into a plain text editor. I'm hoping there's a parameter to cause it to be formatted... ???

Nobody needs a job. Not much, anyway. Before you need a job, there's a lot of other stuff you need. More or less in order of how badly you need them: AIR, WATER, FOOD, SHELTER, CLOTHING, COMPANIONSHIP, and ACTIVITY. You've been led to believe you need money to "pay" someone else to provide those for you - all but AIR, so far. How long is it going to be before you have to "pay" for AIR, too?

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Try this link - should be the compleate GUID

.Text display/return formatted text and .textrtf display/return all or was it reverse, I don't remember, one orther thing is that the component has no default formatting settings at start ( a .doc should initiate default settings ) but if the document is simple you just has to provide this with the command defTextRTF as first command ( read about rich text format )

I remember something about the .Locked command set edit mode on/off and I never got the ScrollBars command to function proper but the OLE drag and drop functions was real cool and I did an application that all kind of things ( icons, applications and text etc. ) could be included into the component and showed as icons ready to edit or fire off - real cool...

A way to change from text to Rtf should be something like this, but i had no trouble displaying rtf code directly...

With $oObj ;Component pool

.text = .TextRtf ; or reverse I don't remember anymore

Endwith

Link

kjactive

Edited by kjactive

Share this post


Link to post
Share on other sites

Try this link - should be the compleate GUID

.Text display/return formatted text and .textrtf display/return all or was it reverse, I don't remember, one orther thing is that the component has no default formatting settings at start ( a .doc should initiate default settings ) but if the document is simple you just has to provide this with the command defTextRTF as first command ( read about rich text format )

I remember something about the .Locked command set edit mode on/off and I never got the ScrollBars command to function proper but the OLE drag and drop functions was real cool and I did an application that all kind of things ( icons, applications and text etc. ) could be included into the component and showed as icons ready to edit or fire off - real cool...

A way to change from text to Rtf should be something like this, but i had no trouble displaying rtf code directly...

With $oObj ;Component pool

.text = .TextRtf ; or reverse I don't remember anymore

Endwith

Link

kjactive

Here's the first little bit of what it displays. In the standard example from the help file for guictrlcreateedit() I replaced the line

.text = "Hello - Au3 supports ActiveX components like the RICHTEXT thanks to SvenP" & @CRLF & 'Try write some text and quit to reload'
;

with

$oRP.LoadFile("c:\scans\libula.doc");

and it displayed

ÐÏࡱá

Ooops - no way to copy this, I guess... I copied it from the gui box, but... anyway, believe me, it's mostly the little square "checkbox" characters that are often displayed when an app doesn't know what else to do, and various graphics squiggles...

I'll visit the link, and also see what, if anything happens with .text and/or .textrtf - I had - as noted - earlier tried .text = $orp.loadfile() without resulting in ANY text at all - I'll fiddle with .text and .textrtf some more.

Thanks!


Nobody needs a job. Not much, anyway. Before you need a job, there's a lot of other stuff you need. More or less in order of how badly you need them: AIR, WATER, FOOD, SHELTER, CLOTHING, COMPANIONSHIP, and ACTIVITY. You've been led to believe you need money to "pay" someone else to provide those for you - all but AIR, so far. How long is it going to be before you have to "pay" for AIR, too?

Share this post


Link to post
Share on other sites

Problem Solved:

Kuller Mi Stoopid

Well, the last thing turns out to be this (to be fair, no one else mentioned it, either, so...):

This (apparently) doesn't display DOC files, only RTF's.

I opened the doc in Wordpad and saved it as libula.rtf, and it shows up just fine... now all I have to do is see if I can get the scroll bars to work (not sure I care about that a whole lot... the page keys work...) and make the box a decent size and put the buttons at the bottom... when I get it done, I'll post it - it should make at least a start on a generic EULA function, if any gives a rodent's posterior.

Thanks to all the helpers!


Nobody needs a job. Not much, anyway. Before you need a job, there's a lot of other stuff you need. More or less in order of how badly you need them: AIR, WATER, FOOD, SHELTER, CLOTHING, COMPANIONSHIP, and ACTIVITY. You've been led to believe you need money to "pay" someone else to provide those for you - all but AIR, so far. How long is it going to be before you have to "pay" for AIR, too?

Share this post


Link to post
Share on other sites

Okay - I've got a working prototype - it's still a WIP, but I'm gonna post it in the example scripts anyway - the word EULA will be in the subject...


Nobody needs a job. Not much, anyway. Before you need a job, there's a lot of other stuff you need. More or less in order of how badly you need them: AIR, WATER, FOOD, SHELTER, CLOTHING, COMPANIONSHIP, and ACTIVITY. You've been led to believe you need money to "pay" someone else to provide those for you - all but AIR, so far. How long is it going to be before you have to "pay" for AIR, too?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0