AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Multimedia Delphi Eigene listbox mit TObjeklist Scroll problem
Thema durchsuchen
Ansicht
Themen-Optionen

Eigene listbox mit TObjeklist Scroll problem

Ein Thema von mimi · begonnen am 9. Sep 2006 · letzter Beitrag vom 18. Jun 2007
 
mimi

Registriert seit: 1. Dez 2002
Ort: Oldenburg(Oldenburg)
2.008 Beiträge
 
FreePascal / Lazarus
 
#1

Eigene listbox mit TObjeklist Scroll problem

  Alt 9. Sep 2006, 11:21
Hallo,
ich habe gestern angefangen eine eigene listbox zu schreiben mit TCanvas.
Jetzt habe ich ein problem mit dem scrollen, hier der code:
Delphi-Quellcode:
procedure Tmylistbox.Draw;
var
  i:Integer;
  s:Char;
  y:Integer;
begin
  HeaderCaption.DrawCaption('',-1,-1);
  FootCaption.DrawCaption(IntTostr(itemIndex)+'\'+IntTostr(Items.count) ,-1,-1);
  Paint.DrawRect(posX,posY,200,150);
  s:=#0; y:=-1;
  if items <> NIL then begin
    for i:=0 to items.count-1 do begin
      with TmyListItem(Items.Items[i]) do begin
        if Caption.isSel = True then begin
           s:='*';
           SetIndex(i);
           FootCaption.fCaption:='Einträge: ' + IntTostr(itemIndex)+'\'+IntTostr(Items.count)+'\' + IntTostr(displaycount) ;
        end
        else begin
          s:=' ';
         SetIndex(-1);
        end;

        if (items.count-1 > displaycount) and (ScrollIndex > 0) and (Caption.fPos.y >displayh) then begin
          if Caption.fPos.y > posY+displayh then
            y:=(posy+Caption.fPos.y)-(posY+displayh)
          else
            y:=-1;

          if y <= 200 then
            Caption.DrawCaption(s,-1,y);
        end
        else begin
          if (items.count-1 <= displaycount) or (scrollindex = 0) then
            if i <=displaycount then
            Caption.DrawCaption(s,-1,-1);
         end;
      end;
    end;
  end;
  FootCaption.DrawCaption('' ,-1,-1);
// FootCaption.fCaption:='Einträge: ' + IntTostr(itemIndex)+'\'+IntTostr(Items.count);
end;
displaycount = Anzahl der angezeigten items
DisplayH = die Fläche in der angezeigt werden kann(die vertikale fläche)
posx, posy:= listbox position

das problem ist jetzt: es wird zwar richtig gezeichnet nur ich weiß noch nicht so recht wie ich es stuern kann, also ich möchte das scrollen beinflussen und genau das ist das problem:
einmal möchte ich über einen scrollbalken und einmal über den itemIndex. kann mir jemmand tipps geben wie das gehen könnte?
Michael Springwald
MFG
Michael Springwald,
Bitte nur Deutsche Links angeben Danke (benutzte überwiegend Lazarus)
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 21:16 Uhr.
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