Недавно добавленные исходники

•  Animation Loaders  746

•  DeLiKaTeS Tetris (Тетрис)  5 738

•  TDictionary Custom Sort  7 691

•  Fast Watermark Sources  7 374

•  3D Designer  10 592

•  Sik Screen Capture  7 901

•  Patch Maker  8 131

•  Айболит (remote control)  8 181

•  ListBox Drag & Drop  6 980

•  Доска для игры Реверси  100 269

•  Графические эффекты  8 256

•  Рисование по маске  7 636

•  Перетаскивание изображений  6 238

•  Canvas Drawing  6 610

•  Рисование Луны  6 534

•  Поворот изображения  5 702

•  Рисование стержней  4 633

•  Paint on Shape  3 336

•  Генератор кроссвордов  4 311

•  Головоломка Paletto  3 459

•  Теорема Монжа об окружностях  4 283

•  Пазл Numbrix  2 771

•  Заборы и коммивояжеры  3 685

•  Игра HIP  2 488

•  Игра Go (Го)  2 478

•  Симулятор лифта  2 873

•  Программа укладки плитки  2 312

•  Генератор лабиринта  3 036

•  Проверка числового ввода  2 538

•  HEX View  2 948

 
скрыть

  Форум  

Delphi FAQ - Часто задаваемые вопросы

| Базы данных | Графика и Игры | Интернет и Сети | Компоненты и Классы | Мультимедиа |
| ОС и Железо | Программа и Интерфейс | Рабочий стол | Синтаксис | Технологии | Файловая система |



Delphi Sources

Изменить экранный курсор без необходимости возвращать предыдущий



Оформил: DeeCo

// By implementing Interface we can set the cursor without restore it in the end. 
// Example: In convensional way... 
var
   Cur: TCursor;
 begin
   Cur := Screen.Cursor;
   Screen.Cursor := crSQLWait;
   //do coding here 
  //What happend is that if your code did not finish, the screen cursor will 
  //remain as crSQLWait.. even with try..finally block (sometimes) 
  Screen.Cursor := Cur;
 end;

 // By using interface, we can implement as follows 
type
   ImyCursor = interface
     [(GUID - Ctrl - Shift - G)]
   end;
   TmyCursor = class(TInterfacedObjects, ImyCursor);
   private
   FCursor: TCursor;
   public
 constructor Create;
   destructor Destroy; override;
     end;

 implementation

 TmyCursor.Create;

 begin
   FCursor := Screen.Cursor;
 end;

 TmyCursor.Destroy;

 begin
   Screen.Cursor := FCursor;
   inherited;
 end;

 procedure....var
   C: ImyCursor;
 begin
   C := TmyCursor.Create;
   Screen.Curosr := crSQLWait; // whatever cursor you like 
  // Do coding here without worring to free it. 
  // Screen Cursor will restore when the TMyCursor object get out of scope. 
end;




Похожие по теме исходники

База данных без BDE

БД без BDE

Кривая Безье

Bezier Curves (кривые Безье)

 

Splay Line (Безье)

Сплайн на 8 точек (Безье)

Text Bezier Curve (Безье)

Кривые Безье на OpenGL

 



Copyright © 2004-2026 "Delphi Sources" by «SiteAnalyzer». Delphi World FAQ

Группа ВКонтакте