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

•  Animation Loaders  1 057

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

•  TDictionary Custom Sort  7 927

•  Fast Watermark Sources  7 584

•  3D Designer  10 823

•  Sik Screen Capture  8 166

•  Patch Maker  8 351

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

•  ListBox Drag & Drop  7 261

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

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

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

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

•  Canvas Drawing  6 801

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

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

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

•  Paint on Shape  3 480

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

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

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

•  Пазл Numbrix  2 860

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

•  Игра HIP  2 582

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

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

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

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

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

•  HEX View  3 048

 
скрыть

  Форум  

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

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