From: Dean H. <dh...@ma...> - 2002-08-13 18:39:25
|
everything seems to be working for me with a few modifications on line 1357 change it to : if tmpX + tmpWidth > Screen.{$IFDEF SYN_COMPILER_6_UP}WorkAreaWidth{$ELSE}Width{$ENDIF} then and line 1363 change it to: if tmpY + tmpHeight > Screen.{$IFDEF SYN_COMPILER_6_UP}WorkAreaHeight{$ELSE}Height{$ENDIF} then The differences being the ifdef. Also I changed the resize event to be this: procedure TSynBaseCompletionProposalForm.Resize; begin inherited; if FFontHeight <> 0 then FLinesInWindow := (Height- FHeightBuffer) div FFontHeight else FLinesInWindow := 0; AdjustScrollBarPosition; Invalidate; end; maybe very slightly less effecient (the if will always have to be evaluated), but the first thing that happened when I started my app was a division by zero error, even thought the except trapped it, and that shouldn't happen, IMO. Looks good, however. Good job. Dean. -----Original Message----- From: Daniel Rikowski [mailto:dan...@ad...] Sent: Tuesday, August 13, 2002 1:46 PM To: Syn...@li... Subject: [Synedit-devel] TSynCompletionProposal progress Hello everybody, I've spent the last hours working on TSynCompletionProposal and I finally managed to improve some parts of it. The code for ctHind mode was very hard to understand. I do not really know what purpose it has so it might be possible that I changed the behaviour. :-( Anyway, I did not touch the class/component interface with one exception: I removed the PreviousWord property since in the original code it was set only at one place (in ctHint mode) to ItemList.Text. In all other modes it was set to an empty string, so it was pretty useless. Can someone please tell me what this property was meant for? The CompletionProposal demo acesses this property but you can comment this specific line out. The demo still works perfectly. But I've got a problem. Since I do not own Delphi 4 or Kylix I could not verify the code to compile under these environments. Can someone test it for me (with the CompletionProposalDemo) and tell me if there are any compiler (and perhaps runtime) errrors? Some of my modifications: Common modifications: * Removed some flickering which was generated by extensive moving of the proposal window. The old code works like this: Let's move the window to (x1,y1) and let's see if it fits on the screen. If not then move it to (x2,y2) and look again. If it still does not fit, move it to (x3,y3), ... Now the position is calculated first and after that the window is moved to the right position. * Tidied up some methods (made them faster and easier to understand) * Other minor modifications In ctCode mode: * Proposal window is now resizeable (without any AVs) * Removed many hardcoded painting constants, now it is easier to modify the window appearance in the future * Collected the code for handling the scrollbar from the different places in the file and put it in one single method (no more scrollbar adjustments during paint cycles *g*) * Removed some unnecessary painting commands In ctParam mode: * Appearance slightly changed, now it has a small 3d border In ctHint mode: * Appearance slightly changed, now it has a small 3d border * Mulitiline hints are displayed properly Regards, Daniel |