Guest

Untitled

By: a guest on Jan 28th, 2012  |  syntax: None  |  size: 0.92 KB  |  hits: 26  |  expires: Never
download  |  raw  |  embed  |  report abuse
Copied
  1. // В client_gui_h.fos
  2. interface IGUIElementCallbackDinamicDraw       {
  3.     void OnDraw(int ElementX, int ElementY);
  4. }
  5.  
  6. // В interface IGUIElementOpt
  7.  
  8. IGUIElementOpt@ CallbackDinamicDraw( IGUIElementCallbackDinamicDraw@ callback );
  9.  
  10. // В client_gui.fos в GUIElement
  11. // В перечень членов
  12. IGUIElementCallbackDinamicDraw@       DinamicDrawCallback;
  13. // В конструктор
  14. @DinamicDrawCallback=null;
  15. /* В void Draw( int screenX, int screenY ) после
  16. if( not (DrawCallback is null) )
  17.             DrawCallback.OnDraw();
  18. вписываем */
  19. if( not (DinamicDrawCallback is null) )
  20.             DinamicDrawCallback.OnDraw(screenX + PosX, screenY + PosY);
  21. // Добавляем функции инициализации каллбэка
  22. IGUIElementOpt@ CallbackDinamicDraw( IGUIElementCallbackDinamicDraw@ callback )
  23.     {
  24.         @DinamicDrawCallback = callback;
  25.         return this;
  26.     }