Script ini memberikan cara pintas yang menunjukkan daftar semua saat ini membuka jam atau.. file cpp

Posted: Selasa, 05 April 2011 by Alfi Haryadi in
0

import IDE;
import editor;

declare kbd = IDE.KeyboardManager.GetKeyboard("Editor");

// Choose a key combination
kbd.Assign("","get_h();");
kbd.Assign("","get_cpp();");

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);
}

0 komentar:


السلام عليكم Assalammualaikum بِسْــــــــــــــــــــــمِ اﷲِارَّحْمَنِ ارَّحِي Cinta itu adalah pembodohan, jangan percaya tentang cinta . . . Karena cinta hanya dapat merusak saraf