Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

Close code completion on "space"?

<< < (3/4) > >>

MortenMacFly:

--- Quote from: mandrav on March 16, 2006, 10:40:55 am ---For these reasons, the scintilla's embedded auto-complete box has been enabled and favoured over our custom implementation.

--- End quote ---
Oh no! I thought the "custom implementation" is better for some reason - thus I enabled it. I mean why would someone use a custom control if the default one is better? I've switched now to the default allthough I got it to work with the custom control, too (using yout hints). ;-)
With regards, Morten.

mandrav:

--- Quote from: MortenMacFly on March 16, 2006, 10:48:46 am ---
--- Quote from: mandrav on March 16, 2006, 10:40:55 am ---For these reasons, the scintilla's embedded auto-complete box has been enabled and favoured over our custom implementation.

--- End quote ---
Oh no! I thought the "custom implementation" is better for some reason - thus I enabled it. I mean why would someone use a custom control if the defautl one is better? I've switched now to the default allthough I got it to work with the cvustom control, too (using yout hints). ;-)
With regards, Morten.

--- End quote ---

The custom control is better in the sense that it displays a lot more info. BUT, it only works well on windows and even then it still has some bugs because of handling raw keycodes...

thomas:

--- Quote from: tiwag on March 16, 2006, 10:33:40 am ---CCList::PositionMe()
doesn't work on dual monitor desktop :(
has anybody any tips how to solve this ?

--- End quote ---
Yes, by turning PositionMe() into SizeMe() and using PlaceWindow(this, pdlConstrain); instead:

--- Code: ---Index: plugins/codecompletion/cclist.cpp
===================================================================
--- plugins/codecompletion/cclist.cpp (revision 2190)
+++ plugins/codecompletion/cclist.cpp (working copy)
@@ -29,6 +29,7 @@
 #include <wx/sizer.h>
 #include <configmanager.h>
 #include <manager.h>
+#include <globals.h>
 
 const wxEventType csdEVT_CCLIST_CODECOMPLETE = wxNewEventType();
 
@@ -72,6 +73,8 @@
 {
  m_StartPos = m_pEditor->GetCurrentPos();
  PositionMe();
+       PlaceWindow(this, pdlConstrain);
+
  int start = m_pEditor->WordStartPosition(m_StartPos, true);
  wxString prefix = m_pEditor->GetTextRange(start, m_StartPos);
 
@@ -106,34 +109,6 @@
  if (h > screenH)
  h = screenH;
 
-// now we 're where we want to be, but check that the whole window is visible...
-// the main goal here is that the caret *should* be visible...
-
-// for the horizontal axis, easy stuff
- if (pt.x + w > screenW)
- pt.x = screenW - w;
-
- // for the vertical axis, more work has to be done...
- if (pt.y + h > screenH)
- {
- // it doesn't fit to the bottom of the screen
- // check if it fits to the top
- if (h < pt.y)
- pt.y -= h + lineHeight; // fits
- else
- {
- // we have to shrink the height...
- // determine if pt.y is closer to top or bottom
- if (pt.y <= screenH / 2)
- h = screenH = pt.y; // to top
- else
- {
- h = pt.y - lineHeight; // to bottom
- pt.y = 0;
- }
- }
- }
- // we should be OK now
  SetSize(pt.x, pt.y, w, h);
 // PlaceWindow(this, pdlConstrain, true);
 }

--- End code ---

MortenMacFly:

--- Quote from: mandrav on March 16, 2006, 10:53:01 am ---The custom control is better in the sense that it displays a lot more info. [...]

--- End quote ---
Yes, I was too fast with writing to the forum. Meanwhile I've realised this, too. :oops: :oops: :oops:
Anyway: Do you think it makes sense to apply the "space" thing generally? It's the same behaviour as the default control then. I could file a patch with the changes I've done but it's actually the code mandrav has already posted... how about it?!
With regards, Morten.

mandrav:

--- Quote from: MortenMacFly on March 16, 2006, 11:16:42 am ---Anyway: Do you think it makes sense to apply the "space" thing generally? It's the same behaviour as the default control then. I could file a patch with the changes I've done but it's actually the code mandrav has already posted... how about it?!
With regards, Morten.

--- End quote ---

Sure, go ahead. All I said is that *I* wouldn't update this code ;)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version