1. VEL Experimental: how to use RICHEDITOR?

Hello,

This question is adressed to Gary Dumer and everybody else who's
got some experience with VEL005 (Experimental version, also called
'bleeding edge').

I'm working on an application that will be using a RICHEDITOR
control to display information in a more or less fancy way,
centered text and all that jazz. But, unfortunately, Gary's
documentation doesn't give me enough support to get things done on
my own. So I'm calling all you VEL enthousiasts to look at my code
and please give me a hand, if you feel like doing so.

TIA, Ad

Here's the code, it's about 70 lines:

-- invoices.exw
-- invoice calculation program
-- Ad Rienks, October 16, 1999
-- email: kwibus at dolfijn.nl

include vel005.e    -- I'm using the 'experimental' version.

without warning

constant NL =3D 13 & 10

constant Form1 =3D CreateControl(FORM, 0)
SetAttribute(Form1, {{CAPTION, "Invoices ver 0.01"},
--                    {FILENAME, "KwiCalc.ico"},
                    {WIDTH, GetAttribute(Form1, SCREENWIDTH)},
                    {HEIGHT, GetAttribute(Form1, SCREENHEIGHT) - 25}})

constant ScrWidth =3D GetAttribute(Form1, SCREENWIDTH)
constant ScrHeight =3D GetAttribute(Form1, SCREENHEIGHT)

-- controls on Form1: -------------------------------------------------=
--------

constant Status1 =3D CreateControl(STATUSBAR, Form1)
SetAttribute(Status1, {{SIMPLEPANEL, TRUE}})

constant DTPicker1 =3D CreateControl(DATETIMEPICKER, Form1)
SetAttribute(DTPicker1, {{DATEFORMAT, LONG}})

constant Panel1 =3D CreateControl(PANEL, Form1)
SetAttribute(Panel1, {{HEIGHT, ScrHeight/3}, {WIDTH, ScrWidth/2}})

constant Memo1=3D CreateControl(RICHEDITOR, Form1)
SetAttribute(Memo1, {{LEFT, ScrWidth/2 + 4}, {WIDTH, ScrWidth/2 - 16},
                    {HEIGHT, ScrHeight/3}, {READONLY, TRUE}, {TABSTOP, =
FALSE},
                    {COLOR, CINFOBK}})

-- controls on Panel1: ------------------------------------------------=
--------

constant Group1 =3D CreateControl(GROUPBOX, Panel1)
SetAttribute(Group1, {{ALIGN, ACLIENT}, {CAPTION, " Invoice Header "}})

constant Static1 =3D CreateControl(STATIC, Group1)
SetAttribute(Static1, {{CAPTION, "Date:"}, {TOP, 20}, {LEFT, 12}})

constant DTPicker2 =3D CreateControl(DATETIMEPICKER, Group1)
SetAttribute(DTPicker2, {{TOP, 16}, {LEFT, 50}})


procedure Form1_OnActivate(integer id, atom p, atom q)
    SetAttribute(Status1, {{SIMPLETEXT, GetAttribute(DTPicker1, TEXT)}}=
)
    SetAttribute(Memo1, {{PARAALIGNMENT, CENTER},
                        {CAPTION, "Invoice Header"}})
    SetAttribute(DTPicker2, {{FOCUS, TRUE}})
end procedure   -- Form1_OnActivate

procedure Date2_OnClick(integer id, atom p, atom q)
sequence text
    text =3D GetAttribute(Memo1, CAPTION)
    SetAttribute(Memo1, {{PARAALIGNMENT, LEFTJUSTIFY}, {SETLINENO, 3},
                        {CAPTION, text & NL & NL & "Date: " & GetAttrib=
ute(DTPicker2, TEXT)}})
    SetAttribute(DTPicker2, {{FOCUS, TRUE}})
end procedure   -- Date2_OnClick

SetEvent(Form1,     ACTIVATE_EVENT, routine_id("Form1_OnActivate"))
SetEvent(DTPicker2, KEYUP_EVENT,    routine_id("Date2_OnClick"))
SetEvent(DTPicker2, CLICK_EVENT,    routine_id("Date2_OnClick"))
SetEvent(DTPicker2, CHANGE_EVENT,   routine_id("Date2_OnClick"))
SetEvent(DTPicker2, ENTER_EVENT,    routine_id("Date2_OnClick"))

ShowForm(Form1, MODAL)
-- end of code

PS, Lewis Townsend, I spoke to Gary about your questions, but I've
lost your email adress. Maybe he can help, if you mail him
privately: dumer9354 at my-deja.com


 | Gratis e-mail en meer: http://www.dolfijn.nl/
 | Een product van Ilse: http://www.ilse.nl/

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu