Delphi-PRAXiS
Seite 2 von 2     12   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Programmieren allgemein (https://www.delphipraxis.net/40-programmieren-allgemein/)
-   -   Interface .. onchange onscroll (https://www.delphipraxis.net/161241-interface-onchange-onscroll.html)

EWeiss 24. Jun 2011 20:46

AW: Interface .. onchange onscroll
 
Zitat:

Zitat von sirius (Beitrag 1108194)
Na dann häng doch der Klasse noch ein weiteres Interface an und caste dahin.


Du kannst auch eine komplett eigene Klasse erstellen mit einem eigenen Interaface, dass gibst du dann an die DLL weiter und die Klasse kennt auch dein IScroll-dinsgbums.

Zitat:

So das ich mich nun für eine Callback entschlossen habe.
gruss

EWeiss 25. Jul 2012 20:52

AW: Interface .. onchange onscroll
 
Muss das Thema nochmal aufgreifen.

Zitat:

Na dann häng doch der Klasse noch ein weiteres Interface an und caste dahin.
Wie kann ich das verwirklichen ist mir nicht klar wie ich das machen soll.

Die ScrollBar ist fertig und die Listbox Flickerfrei beim Scrollen. Mein neues problem ist das wenn ich nun
zwei listboxen erstelle und diesen eine Scrollbar zuweise das die Callback auf beide Listboxen reagiert
und ich diese nicht auseinander halten kann.

Bekomme das irgendwie nicht gebacken.

Aktueller Status sieht so aus.

Delphi-Quellcode:
type
  ISkinScrollBar = interface
    ['{FEAD54BF-FFDD-43E9-9388-5F96A8643948}']
    function GetHandle: hWnd;
    property Handle: hWnd Read GetHandle;
    procedure SetSmallChange(Value: single);
    function GetSmallChange: single;
    procedure SetLargeChange(Value: single);
    function GetLargeChange: single;
    procedure SetMinVal(Value: single);
    function GetMinVal: single;
    procedure SetMaxVal(Value: single);
    function GetMaxVal: single;
    procedure SetVal(Value: single);
    function GetEnabled: BOOL;
    procedure SetEnabled(Value: BOOL);
    function GetVisible: BOOL;
    procedure SetVisible(Value: BOOL);
    function GetVal: single;
    procedure SetScrollBarCallBack(callback: SCROLLSTATE_CALLBACK); stdcall;
  end;

  TSkinScrollBar = class(TInterfacedPersistent, ISkinScrollBar)
  private
    FHScrollBar: HWND;
    ImgW, ImgH: cardinal;
    Style:  DWORD;
    FLargeChange: single;
    FSmallChange: single;
    FDownSelectedFrame: Integer;
    FUPSelectedFrame: Integer;
    FThumbSelectedFrame: Integer;
    FMinVal: single;
    FMaxVal: single;
    FEnabled: BOOL;
    FVisible: BOOL;
    FVal:   single;
    FBackgroundHeight: single;
    function GetHandle: hWnd;
    function GetLargeChange: single;
    function GetSmallChange: single;
    function GetMinVal: single;
    function GetMaxVal: single;
    function GetVal: single;
    function GetEnabled: BOOL;
    function GetVisible: BOOL;
    procedure SubClass(WinHandle: HWND);
    procedure UnSubClass(WinHandle: HWND);
    procedure SetLargeChange(Value: single);
    procedure SetSmallChange(Value: single);
    procedure SetMinVal(Value: single);
    procedure SetMaxVal(Value: single);
    procedure SetVal(Value: single);
    procedure SetEnabled(Value: BOOL);
    procedure SetVisible(Value: BOOL);
    procedure CalculateThumbBarTop;
    procedure SetThumbBarHeight;
    procedure DrawBasicScrollBar;
    procedure PaintBar(FramePos: integer = 1);
    function ScrollBarProc(WinHandle: HWND; Msg: UINT; wP: WParam;
      lP: LParam): LRESULT; stdcall;
    function IsMouseOver(WinHandle: HWND): BOOL;
    function CheckValidPosition: BOOL;
    procedure ClientWndProc(var Message: TMessage);
    procedure OnMouseDown(WinHandle: HWND; Button: integer; x, y: integer);
    procedure onMouseUp(WinHandle: HWND; Button: integer; x, y: integer);
    procedure onMouseMove(WinHandle: HWND; Button: integer; x, y: integer);
    procedure DrawUPButton(FramePos: integer = 1);
    procedure DrawDownButton(FramePos: integer = 1);
    procedure SetScrollBarCallBack(callback: SCROLLSTATE_CALLBACK); stdcall;
    procedure RemoveScrollBarCallback; stdcall;
    procedure UpdateLastPosition;
    procedure ResizeWindow(WinHandle: HWND);
  public
    property Handle: HWND Read FHScrollBar;
    constructor Create(hOwner: HWND; PageImg, DownImg, UpImg, ThumpImg: WideString;
      x, y, yH, CtrlID, StateMax: integer);

    destructor Destroy; override;
  end;


gruss


Alle Zeitangaben in WEZ +1. Es ist jetzt 22:13 Uhr.
Seite 2 von 2     12   

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz