Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ TheIDE » U++ TheIDE: CodeEditor, Assist++, Topic++ » CodeEditor: CopyWord; SwapChars [FEATURE REQUEST][ADDED]
CodeEditor: CopyWord; SwapChars [FEATURE REQUEST][ADDED] [message #2592] Tue, 18 April 2006 13:50 Go to previous message
gprentice is currently offline  gprentice
Messages: 260
Registered: November 2005
Location: New Zealand
Experienced Member
Hi

I've written CopyWord and SwapChars for CodeEditor coz these are things I use a lot. They seem to work (including when hard tabs are involved) - I tested them a little bit ... Smile - but only on Win XP. Hopefully Mirek could consider adding them to CodeEditor.cpp, if he has time and wants to ... but if not, that's ok.

It took me longer than the ESC macro versions I wrote a while ago coz there isn't a nice help file of how to do everything like there is for ESC. Surprisingly, TheIDE is sometimes better at navigating UPP source than slickedit! (it's great to have Alt left, Alt right in TheIDE).

I don't know what the clipboard stuff is doing - I just copied the Copy() function. I notice that copying something in TheIDE results in four copies going to the clipboard because I have another editor (EditPlus) that allows me to monitor the clipboard and all copied stuff turns up 4 times in EditPlus Smile

Graeme


void CodeEditor::CopyWord() {
   int p = GetCursor();
   if(iscid(GetChar(p)) || (p > 0 && iscid(GetChar(--p))))
   {
      int e = GetLength();
      int f = p;
      while(--p >= 0 && iscid(GetChar(p)));
      ++p;
      while(++f < e && iscid(GetChar(f)));
      WString txt = GetW(p, f - p);
      WriteClipboardUnicodeText(txt);
      WriteClipboardText(txt.ToString(), false);
   }
}

void CodeEditor::SwapChars() {
   int i = GetLine(cursor);
   int j = GetPos(i);
   if (j < cursor && (cursor-j) < line[i].GetLength())
   {
      int p = cursor;
      WString txt(GetChar(p-1),1);
      Remove(p-1,1);
      Insert(p, txt, true);
      PlaceCaret(p);
   }
}

[Updated on: Tue, 02 May 2006 04:26] by Moderator

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Assist++: class _DLL_ENTRY __declspec(dllexport) [BUG?][WORKAROUND]
Next Topic: Assist++ "go to..." keys [SUGGESTION]
Goto Forum:
  


Current Time: Fri Apr 19 16:07:52 CEST 2024

Total time taken to generate the page: 0.03534 seconds