On Fri, Oct 19, 2001, MATSUMOTO Masakazu wrote:
> I'm testing the feature to copy text and link URLs to memopad
Cool!
> I think there must be much better way to take snapshot without
> redrawing full paragraph,
I think that should be possible to fix...
> Anyway i want your opinion.
I might have time to take a closer look at the code on Sunday, but
in the meantime you could clean up the layout of your changes ;-)
- use spaces for clarity
- no C++ style comments, i.e. only /* */ not //
- indentation is 4 characters
- try to write numeric expressions in number-line order, so that you
have comparisons like,
MinVal <= i && i <= MaxVal
<----------------|====================================|--------------->
valid values for i
i < MinVal || MaxVal < i
MinVal MaxVal
<================|------------------------------------|===============>
valid values for i valid values for i
This approach gives you a visual image of the comparison.
- in a test like this "if(GetHardcopyMode()==true)", you should drop
the "==true" part
- a statement like the following
inView=(tContext->cursorY>0)&&(tContext->cursorY<ymax)
should be replaced with,
if ( 0 < tContext->cursorY && tContext->cursorY < ymax )
inView = true;
else
inView = false;
BTW, a y position larger than zero doesn't necessarily mean the
text is visible (it could be under the toolbar). TopLeftY() will
give you the *visible* top y position.
- in pointer declarations, the pointer indicator * is placed
immediately after the type identifier, that is, the asterisk
is associated with the type, not the variable, e.g.
Char* text;
This is the style I want the viewer code to follow and if any code
sent to me is written in this style it will be much easier for me
to add it to the main version.
/Mike