[TextEditor-mcc] Re: How can take not marked blocks (useful for sintax highlight)

  • From: "Gianfranco \"ShInKurO\" Gignina" <sh1nkur0@xxxxxxxxx>
  • To: texteditor_mcc@xxxxxxxxxxxxx
  • Date: Wed, 04 Mar 2009 11:57:15 +0100

Il  4-Mar-2009, Jens Langner scrisse:

> Hi Gianfranco,
>
> Gianfranco "ShInKurO" Gignina schrieb:
>
> [...]
>>> is there any way to insert some coordinates (for example startx,
>>> starty, stopx, stopy) and retrieve than block of text without mark
>>> it?
>
>>> I would want implement sintax highlight on NoWinED, but without to
>>> retrieve a block without to mark it the only way could be to get
>>> content of texteditor, to read last word, and if should be coloured,
>>> mark it on texteditor and coloured it... I find this few good...
>>>
>>> Suggestions?
>> 
>> Nevermind, I've just implemented it into TE sources:
>> 
>> basically I've addd some attributes to struct
>> MUIP_TextEditor_ExportBlock which are considered only if flag is
>> MUIF_TextEditor_ExportBlock_TakeBlock, so in this case you can take a
>> block without to select it, only specifing coordinates.
>> 
>> I've even added MUIM_TextEditor_SetBlock, which is useful to change a
>> block of text without to select it, always specifing coordinates. For
>> now are supported changing of colour block and style of block...
>> 
>> Here diff file...
>
> First of all, thanks for finally considering to implement the stuff
> yourself :) This is exactly what open source is for. If you need
> something and there is nobody maintaining the same area in the code
> yet, it is always better to go and see if you can implement it
> yourself.
>

I would like to do this, if only I was able to do all :)

> However, to correctly understand your changes I have to request that
> you remove the load of unnecessary noise in your submitted diff file.
> That means I can see a lot of unnecessary changes like:
>
> here the diff was just produced because you changed the indentation.
> You probably used TABs when coding. However, we do not accept any
> tabulator spaces in the source code. 

I know this, but I've only setted tabs as 2 spaces (loading and writting) as
you suggest into yam dev guide, in fact I've left only changes which fix
some wrong tabs probably don't seen by your editor :)
In fact thing like this:

// some own usefull MUI-style macros to check mouse positions in objects
-#define _between(a,x,b)    ((x)>=(a) && (x)<=(b))
-#define _isinobject(o,x,y)     (_between(_mleft(o),(x),_mright (o)) &&
_between(_mtop(o) ,(y),_mbottom(o)))
-#define _isinwholeobject(o,x,y)    (_between(_left(o),(x),_right (o)) &&
_between(_top(o) ,(y),_bottom(o)))
+#define _between(a,x,b)           ((x)>=(a) && (x)<=(b))
+#define _isinobject(o,x,y)        (_between(_mleft(o),(x),_mright (o)) &&
_between(_mtop(o) ,(y),_mbottom(o)))
+#define _isinwholeobject(o,x,y)   (_between(_left(o),(x),_right (o)) &&
_between(_top(o) ,(y),_bottom(o)))


it shows as I fix a wrong indendation :-)

So please cleanup your changes and
> resubmit them here. This will help us all to better understand what
> exactly you have done and to integrate them properly into the SVN
> respository.

if you want I could do this, but you have to tell me how download/cancel my
changes with svn so I don't do this with hand ;-) 


> Sorry, don't get it. What exactly do you want to achieve?

I want insert real \t support to TE MCC, I've just a proper custom Text()
function to right translate on the fly \t into n spaces (to use instead of
plain Amiga Text() function), it works on TextEditorMCC, but when I move
cursor with arrow buttons on a line which has a translated \t then that
line is updated by cursor as my past translation of \t was not done. So,
for example with topaz font, line with a \t=4spaces is rewritten(redraw) by
cursor considering \t as 1 character (because topaz draws \t as 1 rectangle
char), and thus text is bad drawn.
I've tried to modify SetCursor(), LineCharsWidth() functions, but I've not
solved this issue, probably because I've no understand as TE rendering
functions work (or if they are really the TE's rendering functions), so I'd
like to receive some suggestions about where I should modify sources:-)

-- 
Bye, 
Gianfranco "ShInKurO" Gignina

http://shinkuro.amiga.it

-- 
_____________________________________________________________________________
TextEditor ML   - //www.freelists.org/list/texteditor_mcc
Listserver help - mailto:texteditor_mcc-request@xxxxxxxxxxxxx?Subject=HELP
Bugtracker......: http://sourceforge.net/tracker/?atid=731469&group_id=135025


Other related posts: