ThreadBoard ArchivesSite FeaturesActiveworlds SupportHistoric Archives |
[VB] RichTextBoxTab (Sdk)
[VB] RichTextBoxTab // Sdkstrike rapierNov 10, 2002, 8:03pm
Could anyone tell me if there is a way to set a single tab in a VB rich edit control OCX so after the first tab all the text will align (like in the AW browser, Xelagot etc)
Cheers - Mark baronNov 10, 2002, 8:37pm
With RichTextBox
.SelTabCount = 1 ' or more if you need them .SelTabs(1) = 500 ' set width for each tab from left edge .SelHangingIndent = 500 ' this will do the trick, text will wrap at this indent after vbTab End With http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rtfbox98/html/vbproselhangingindent.asp [View Quote] strike rapierNov 11, 2002, 7:04pm
It stopped dead because after spending £40+ on a book on VC++ I read though the first several chapters on it, then skipped to the end, to find it was still ranting on about Console applications which are about as much use to me in making bots (what first took me to programming) as a dead fish because I cant execute the darn aw_wait loop and enter commands at the same time unless there is some fundamental lack of knowlege im missing.
I tried using MFC dialog, but to my absolute fury couldent find a single way to convert a Rich Text Box formatting function Baron gave me for VB into C++, and despite near hundreds of attempts with differnt code it all went pear shape so a few of my bots I was going to port ended up being left in my VB folder. Also, having not much experience in C++ I decided id do World Tracker which protects AWNewbie in VB and add multi threading and such to make it as good as it could possably be, until the multi threading exploded in my face after compile, so some of the bots just got binned. Ive tried picking Hamfons Hambot appart piece by piece since I got it several months ago without much sucess at finding the core components of it to study. Gah working with GUIs is so fustraighting!!!! I have no idea how a rich text edit OCX based on a CString class can miss out the damn GetLength function and using strcpy into a char[] just makes the whole darn thin explode... so all in all no good experiences with it. A while ago I stuck together an events bot that just displayed all the events in a console app that happened in AW which actually worked for once, until it got wiped out by a format due to Microsofts bad system recovery designs. So all in all, my adventure into C++ has sank like a rock made out of lead, gone to dissaster because after spending ages reading and practicing, I still cant even start what id like to do because my learning resources are absolutly crap here. Jeeze why dosent my school teach computer science!!!! Oh yeah, because theres only 3 students (myself included) that even know how to load up a macro in MS word.... >_< Talk about having the urge to go but nowhere to get to to learn the darn things!!! C++ has been a traumatic experience for me :( - Mark [View Quote] bowenNov 11, 2002, 7:07pm
bowenNov 11, 2002, 7:27pm
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndllpro/html/msdn_t
hreads.asp I hope this helps you somewhat. I assume if you want users to type things in while it's running you'd have the main thread be running while it waits for the user to press return to end a string. The string can then be used by you in whatever way while the other processes run in the background. --Bowen-- binarybudNov 11, 2002, 8:01pm
or click this link to go there...:)
http://makeashorterlink.com/?T23412A62 thanx Bowen Leo :) [View Quote] bowenNov 11, 2002, 8:38pm
[View Quote]
That too. :D
I'll tell you this now, multithreading and synchronization is a pain in the butt. --Bowen-- milestegNov 11, 2002, 9:24pm
"bowen" <thisguyrules at 7k2.4mg.com.ANTISPAM> a écrit dans le message de news:
3dd0314a$1 at server1.Activeworlds.com... > [View Quote] it is a snap in java ;))) MilesTeg milestegNov 11, 2002, 9:46pm
"bowen" <thisguyrules at 7k2.4mg.com.ANTISPAM> a écrit dans le message de news:
3dd03cc6 at server1.Activeworlds.com... > > Psh, you java monkey! > > --Bowen-- > > yup...houba houba.. :)) *jumping back to his java tree* MilesTeg grimbleNov 12, 2002, 8:13am
I know there are those around that prefer command line apps, but I'm a great
fan of MFC Windows Apps (even if MS have decided to change direction AGAIN!). Yes you need to go around the houses to do simple things like setting a static text control to bold, but the app code to me is so much cleaner than VB's "everything's an object" approach. Not looking forward to ..NET to be honest, especially relearning VB for prototypes and such. I've not written a console app since I went on my initial C++ training course back in the mid 90s. Anyway, I digress ... The part you're looking for to format the Rich Edit box in C++ with the MFC is SetParaFormat (updating a PARAFORMAT structure). I don't go for using a control as an ATL object in C++, it seems so unnecessary. Attached is a code snippet that works which you can adapt to your needs (stick it in the OnInitDialog method of the Dlg class). Look up the PARAFORMAT2 struct on MSDN for more details. If you want, I've created a workspace with project where this can be demonstrated, but I have a tendency to use project names that are ... umm ... inappapropriate for posting here when I'm playing around investigating things. If you'd like me to send the workspace directory to you, just e-mail me. As for the aw_wait, I just do it the "VB Way" with an aw_wait(0) somewhere under a WM_TIMER windows message (SetTimer/KillTimer/OnTimer) in a dialog. Nice and clean that way (again, its preference). The AppWizard sets up the project for you and the features of VC++ handle the addition on new message perfectly well. Its all about perseverance Mark (and the right books/resources heh). MFC is your friend, it just takes some getting to know. Ultimately though, I've found it very rewarding. Stick with it. Grims [View Quote] begin 666 strikeRE.txt M("\O4F5T<FEE=F4 at 82!P;VEN=&5R('1O('1H92!2:6-H($5D:70 at 0F]X#0H at M0U)I8VA%9&ET0W1R;"H at <$UY4FEC:$5D:71";W at at /2 H0U)I8VA%9&ET0W1R M;"HI1V5T1&QG271E;2A)1$-?4DE#2$5$250Q*3L-" at T*("\O(%1U<FX at ;VX at M=V]R9"!W<F%P#0H at <$UY4FEC:$5D:71";W at M/E-E=%1A<F=E=$1E=FEC92A. M54Q,+" P*3L-" at T*("\O($1E9FEN92!T:&4 at <&%R86=R87!H(&9O<FUA= T* M(%!!4D%&3U)-050R('!F.PT*('!F+F-B4VEZ92 ]('-I>F5O9BAP9BD[#0H at M<&8N8U1A8D-O=6YT(#T at ,3L-"B!P9BYR9WA486)S6S!=(#T at ,3 P,#L-"B!P M9BYD>$]F9G-E=" ](#$P,# [#0H at <&8N9'=-87-K(#T at *%!&35]404)35$]0 M4R!\(%!&35]/1D93150I.PT*#0H at +R\ at 4W1O<F4 at =&AE('!A<F%G<F%P:"!F M;W)M870-"B!P37E2:6-H161I=$)O>"T^4V5T4&%R849O<FUA="AP9BD[#0H- M"B O+R!!9&0 at <V]M92!T97-T('1E>'0-"B!#4W1R:6YG('-Z4D5497AT.PT* M('-Z4D5497AT(#T at (D-H<FES.EQT5&AI<R!I<R!A(&9O<FUA='1E9"!2:6-H M($5D:70 at 0F]X7&Y-87)K.EQT5V]W+"!T:&ES(%)I8V at at 161I="!S='5F9B!A M:6XG="!A<R!B869F;&EN9R!A<R!I="!F:7)S="!S965M<R!I<R!I="$A("XN M+B J9FEL;', at ;W5T('1H92!L:6YE(&EN(&%N(&%T=&5M<'0 at =&\ at 9F]R8V4 at M82!W;W)D('=R87 J(CL-"B!P37E2:6-H161I=$)O>"T^4V5T5VEN9&]W5&5X ..="AS>E)%5&5X="D[#0H` ` end strike rapierNov 13, 2002, 8:29pm
Thankya Grimble,
Yeah, Ive noticed you need to go "around the house" with C++, which is a bit of a downer, but usefull for making em more powerfull. Ill just have to keep with it, having an IT teacher in RL would be nice, but unfortunatly at this time Im teaching my own darn class most the time... - Mark [View Quote] |