Script ini memberikan cara pintas yang menunjukkan daftar semua saat ini membuka jam atau.. file cpp
Posted: Selasa, 05 April 2011 by Alfi Haryadi inimport IDE;
import editor;
declare kbd = IDE.KeyboardManager.GetKeyboard("Editor");
// Choose a key combination
kbd.Assign("
kbd.Assign("
ChooseFile(ext)
{
declare buffersArray = new array [];
declare i = 0;
declare firstBuffer = editor.TopBuffer;
if( firstBuffer == NULL || !initialized(firstBuffer) ){
print "First Buffer invalid";
return;
}
declare current = firstBuffer;
do {
if( current.TopView != NULL){
declare currExt = new String(current.Extension);
currExt.Upper();
if( currExt.Text == ext.Text ){
buffersArray[i] = current.FullName;
i++;
}
}
current = current.NextBuffer(false);
} while( firstBuffer.FullName != current.FullName );
if( i == 0 ){
print "No modules";
return;
}
declare popup = new PopupMenu(200, 100, buffersArray);
declare res = popup.Track();
if( res == "" ) return;
current = firstBuffer;
for( declare j=0 ; ; current = current.NextBuffer(false),j++ ){
if( current.FullName == res ){
current.TopView.Window.IsHidden = false;
current.TopView.Window.Activate();
break;
}
}
}
get_cpp()
{
declare ext = new String(".CPP");
ChooseFile(ext);
}
get_h()
{
declare ext = new String(".H");
ChooseFile(ext);
}