April 30, 2024, 06:57:31 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Setting Tabs in a Rich Edit control

Started by GWS, February 26, 2010, 10:25:39 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

GWS

Hi guys,

I'm supposed to be snoozing, but I've discovered this ..  :)


def w1:Window
def tab[6]:Int
def ptr:pointer

' example of setting Tabs in a Rich Edit control ..
' set the Tab positions ..
tab[0]=5,10,15,20,25,30
ptr = tab[0] :'A pointer to the Tab[] array
Const EM_SETTABSTOPS = 0xCB
Window w1,0,0,400,300,@Size,0,"Tab Test",messages
setwindowcolor w1,rgb(0,90,90)

Control w1,"RE,,(400-200)/2,50,200,100,@HScroll|@VScroll|@CTEditMulti|@CTEditAutoV|@CTEditAutoH ,10"
setcontrolcolor w1,10,0,rgb(200,200,200)

' set the tabbing ..
SendMessage(w1, EM_SETTABSTOPS, 1, ptr, 10)

WaitUntil w1=0
End

Sub messages
   Select @Class
      Case @IDCreate
         CenterWindow w1
      Case @IDCloseWindow
         CloseWindow w1
   EndSelect
Return



Just thought it might prove useful ..

all the best, :)

Graham
Tomorrow may be too late ..

tbohon

Thanks for the code, Graham.

Hey, if it makes you feel any better about missing your nap, I've got you covered ... in the middle of a 3+ hour conference call and I'm sure glad that long ago I learned to sleep with my eyes open.

Borrrrrrrriiiiiiiiggggggggggggggggg   :)

"If you lead your life the right way, the karma will take care of itself ... the dreams will come to you."  -- Randy Pausch, PhD (1961-2008)