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

•  Animation Loaders  842

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

•  TDictionary Custom Sort  7 754

•  Fast Watermark Sources  7 431

•  3D Designer  10 658

•  Sik Screen Capture  7 974

•  Patch Maker  8 188

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

•  ListBox Drag & Drop  7 049

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

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

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

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

•  Canvas Drawing  6 667

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

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

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

•  Paint on Shape  3 379

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

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

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

•  Пазл Numbrix  2 790

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

•  Игра HIP  2 510

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

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

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

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

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

•  HEX View  2 970

 
скрыть

  Форум  

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

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