Einzelnen Beitrag anzeigen

bluescreen25

Registriert seit: 27. Nov 2005
Ort: Geldern
229 Beiträge
 
Delphi 7 Enterprise
 
#3

Re: Skinroutine schneller machen

  Alt 19. Feb 2008, 16:28
Zitat von Bernhard Geyer:
Probier lieber mal mit AQTime oder nicht was anderes das bremsene Element ist. Ich glaube nicht das die Dateibestimmung und das laden wirklich das bremsende Element ist.
Ich lade es gerade mal runter. Mal schaun.

Hier mal ein Auszug der Schleife rein nur für die Buttons einzulesen, alle anderen Elemente sindähnlich aufgebaut:

Delphi-Quellcode:
for iIndex := 0 to 30 do
    begin
      iString := lowercase(Ini.ReadString(Menu,'Button' + IntToStr(iIndex) + 'Function','0'));
      If iString = '0then Goto ButtonEnde;
      SkinButton := TcAVeButton.Create(SkinForm);
      with SkinButton do
      begin
        FunktionButton[Skin].Add(iString);
        Parent := SkinForm;
        Aktion := Menu;
        Tag := iIndex;
        Funktion := iString;
        TouchMode := Touch;
        FixMode := TouchFix;

        if FileExists(SkinPfad + Ini.ReadString(Menu,'Button' + IntToStr(iIndex) + 'Up','')) then
        UpPicture.LoadFromFile(SkinPfad + Ini.ReadString(Menu,'Button' + IntToStr(iIndex) + 'Up',''));
        OverPicture := UpPicture;
        DownPicture := UpPicture;
        if FileExists(SkinPfad + Ini.ReadString(Menu,'Button' + IntToStr(iIndex) + 'Over','')) then
        OverPicture.LoadFromFile(SkinPfad + Ini.ReadString(Menu,'Button' + IntToStr(iIndex) + 'Over',''));
        if FileExists(SkinPfad + Ini.ReadString(Menu,'Button' + IntToStr(iIndex) + 'Down','')) then
        DownPicture.LoadFromFile(SkinPfad + Ini.ReadString(Menu,'Button' + IntToStr(iIndex) + 'Down',''));
        if FileExists(SkinPfad + Ini.ReadString(Menu,'Button' + IntToStr(iIndex) + 'StatusTrue','')) then
        BoolTruePicture.LoadFromFile(SkinPfad + Ini.ReadString(Menu,'Button' + IntToStr(iIndex) + 'StatusTrue',''));
        if FileExists(SkinPfad + Ini.ReadString(Menu,'Button' + IntToStr(iIndex) + 'StatusFalse','')) then
        BoolFalsePicture.LoadFromFile(SkinPfad + Ini.ReadString(Menu,'Button' + IntToStr(iIndex) + 'StatusFalse',''));

        BoolPicXPos := Ini.ReadInteger(Menu,'Button' + IntToStr(iIndex) + 'PicXPos',0);
        BoolPicYPos := Ini.ReadInteger(Menu,'Button' + IntToStr(iIndex) + 'PicYPos',0);
        SetBounds(Ini.ReadInteger(Menu,'Button' + IntToStr(iIndex) + 'X',0),Ini.ReadInteger(Menu,'Button' + IntToStr(iIndex) + 'Y',0),UpPicture.Width ,UpPicture.Height);

        KeyListX[Skin].Add(IntToStr(Ini.ReadInteger(Menu,'Button' + IntToStr(iIndex) + 'X',0)+ (UpPicture.Width div 2)));
        KeyListY[Skin].Add(IntToStr(Ini.ReadInteger(Menu,'Button' + IntToStr(iIndex) + 'Y',0)+ (UpPicture.Height div 2)));
        if SkinButton.Funktion = 'executeappthen AppIndex := Ini.ReadInteger(Menu,'Button' + IntToStr(iIndex) + 'AppIndex',0);

        Font.Color := HTMLColorToColor(Ini.ReadString(Menu,'Button' + IntToStr(iIndex) + 'LabelColor','&H000000'));
        Font.Name := Ini.ReadString(Menu,'Button' + IntToStr(iIndex) + 'LabelFont','Arial');
        Font.Size := Ini.ReadInteger(Menu,'Button' + IntToStr(iIndex) + 'LabelFontSize',0);
        iString := lowercase(Ini.ReadString(Menu,'Button' + IntToStr(iIndex) + 'LabelFunction',''));
        if (iString <> '') and (iString <> 'text') then FunktionButtonLabel[Skin].Add(iString);
        Caption := Ini.ReadString(Menu,'Button' + IntToStr(iIndex) + 'LabelCaption','');
        LabelXPos := Ini.ReadInteger(Menu,'Button' + IntToStr(iIndex) + 'LabelX',0);
        LabelYPos := Ini.ReadInteger(Menu,'Button' + IntToStr(iIndex) + 'LabelY',0);
        OnMouseDown := SkinButtonMouseDown;
        OnMouseUp := SkinButtonMouseUp;
        OnClick := SkinButtonClick;

      end;

      if (iString <> '') and (iString <> 'text') then ObjektButtonLabel[Skin].Add(SkinButton);
      ObjektButton[Skin].Add(SkinButton);
      Application.ProcessMessages;
    end;

ButtonEnde:
Ob das ne Bremse din ist, weiss ich net.

Gruß, bluescreen
...und ich dachte, Delphi ist ein Programmgenerator mit nur einem Button......tzzz
  Mit Zitat antworten Zitat