N-O: HOW2 SelectTextStretch given beg, end ?
Since linux-ETHZ-oberon allows multiple desktops, this makes programming easier. You can have a separate desktop for your docu/tutors. Some docus want eg. a full size UserTrack to view. Also separate desktop[s] for your notes/log-of-progress. And of course a separate desktop for the source being compiled. Although you can't cutNpaste between desktops [which are separate linux-processes] communication via common file[s] is convenient. These increased facilities prompted me to investigate making a tool which reduces the frustration of locating the 'closing-bracket'/"END-token" of 'blocks which stretch over multiple screens. The ' "END" terminated blocks' begin with one of: "BEGIN","WHILE", "FOR","IF", "LOOP". I think that only leaves "REPEAT" ? I morphed Chapter5.Text Example7 to make the tool which I'm now using; which after setting the caret before the 'opening bracket token' eg. "IF", moves the caret to the corresponding "END". [I'll put the 'project' to Edgar's wiki later.] It would be nice if the 'block' could be selected, instead of just moving the caret to the "END". This would even allow a single clux [N-O mouse chord] to colour the block ! One would: select the opening token & execute 'Do.SelctBlk', and see the block selected -- possibly over multiple screens. And then have the ability to copy, colour ..etc. the block ? I can't see how to select the TextStrech, given the beg, end. There's plenty sample code and tutorials on GetSelection, but SetSelection seems to be a taboo - not recommended. My first/simplest approach failed: 1. exercise the given example[s] for GetSelection, 2. trace the SelectMesg fields: beg, end to confirm, 3. modify these 2 fields eg. to beg+3, end+5, and the id field frrom Oberon.get to Oberon.set and hope that the other unchaged fields are OK. This fails with no symptoms. I can't guess where the code would be to 'SetSelection' as per mouse activation ? Can someone advise/help ? Thanks, == Chris Glur.
I can't guess where the code would be to 'SetSelection' as per mouse activation ?
In ETH Oberon v2.4 Plugin for Windows 'TextFrames.SetSelection' looks promising. Chris Burrows CFB Software http://www.cfbsoftware.com/gpcp
For me, the following code works in Bluebottle Oberon: moving the current selection by 5 characters: PROCEDURE MoveSelection*; VAR M: Oberon.SelectMsg; BEGIN (* get current selection *) M.F := NIL; M.id := Oberon.get; M.time := -1; M.text := NIL; Display.Broadcast(M); (* move selection by 5 characters *) M.id := Oberon.set; M.beg := M.beg+5; M.end := M.end+5; Display.Broadcast(M) END MoveSelection; setting a new selection in the marked (*) text: PROCEDURE SetSelection*; VAR M: Oberon.SelectMsg; BEGIN (* get marked text and select chars 5..10 *) M.sel := Oberon.MarkedFrame(); M.text := Oberon.MarkedText(); M.id := Oberon.set; M.time := -1; M.beg := 5; M.end := 10; Display.Broadcast(M) END SetSelection; The complete source follows below. --Bernhard http://aces.snu.ac.kr/~bernhard/bluebottle/Select.Mod AsciiCoder.DecodeFiles Select.Mod ~ gO0EUQ7M4mfHciRCUM7A_=60000000b0B1`m8H4000`@3m6K_9703h0000PA\56M0400<mfH[E6I 04003mVKd9gK\=7010`CbM6038Z00000K;DB595H0000R100000000000>30`7`800001lTHU9gK ^53<^<eH^iRA^A70?00230000P`000@C?ADE<E48CE6KU=6Mk02:ZX281E5E8mTDP8RHU9b>P0EE B1eCCE48R<GId1bLUaFISAGJ_i68TEFK_9b>PXB:=d@B=1eCBA58?9FIbmVK\02EUQ7Mca284UfL `aFHi]C3=0UD?=DA4EUD51BC_IGICE6KU=6MYmVKZ\C3F5TDPdT>PlTHU9gK^ibDUaFISAGCcMf> =8DA7UTC=T0:Z0bIUA78SEWLbEVKd1bLUaFISAGJ_i68ZTB39dT;61R>m0RC9ad>PdT;YA68jd38 ?9FIbmVK^LFId]38=i2MYeFIPXC?PdB<k0BC^@GIhA78jd38>U4Ck02AY=7L\5FN^8TL_56IS5fL dQBCY\C39d@2XX28]mVMU1bLUaFISAGJ_i68RU78e0bHX5VLQ=6MU9gLPXB:=T@C^T6IPXC?PlTH U9gK^ibLUAg>PdT;REfIPXC?PdT;REfI[Dc>PdT;Ui6IPXC?PdT;Ui6I[Dc>P@DJc17KQUW;29gK QAfHQ=7MXdD:=DTC41BC_IGICE6KU=6MYmVKkd@3@9eC3E4AE9EAP<EId=EI\EfHdUfK^Yb>=HE@ B1BCj0bCREVL_iV;CE6KU=6M==gIkdP@5MDB>e@2XX28WE6MPdFHb]FIT12MUQ7MP4VKT1bLUaFI SA78SQFHb=78ehR;a038ZTB39dT;cE6KPXC?P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