Einzelnen Beitrag anzeigen

Benutzerbild von mika
mika

Registriert seit: 25. Okt 2002
176 Beiträge
 
Delphi 6 Professional
 
#2

nochmal ich

  Alt 27. Feb 2003, 10:45
Hier nochmal n bisschen Code von mir, vielleicht habe ich
ja auch da was falsches drinne ?!

Delphi-Quellcode:
  TMyCoords = Packed Record
    Column: Word;
    Row: Word;
    Top: Word;
    Left: Word;
    Bottom: Word;
    Right: Word;
  End;

  TMyInformation = Packed Record
    msdDay: TDate;
    msdWDay: String[12];
    msdPerson: String[50];
    msdPersonNR: String[5];
    msdActualKosten: String[5];
    msdNormalKosten: String[5];
  End;

  TCreateIt = Record
    _ID: Integer;
    Top: Integer;
    Left: Integer;
    State: Word;
    _Date: TDate;
    col: integer;
    row: Integer;
    coords: TMyCoords;
    _Caption: String;
    _Color: TColor;
    Person: String;
  End;

  TMySpecialDay = class(TShape)

    mytitel: TStaticText;
    constructor NCreate ( how: TCreateIt ); // Constructor
    destructor Destroy; override; // Destructor

    private
      msdID: Integer;
      msdState: Word;
      // ---
      msdCoords: TMyCoords;
      msdInfo: TMyInformation;
      // ---
      msdChanged: Boolean;
      msdStatebeforeChange: Word;
      msdSelected: Boolean;
      public
      procedure onMyMouseDown(Sender: TObject; Button: TMouseButton;
                              Shift: TShiftState; X, Y: Integer);
      procedure onMyMouseMove(Sender: TObject; Shift: TShiftState; X,
                              Y: Integer);
      procedure onMyMouseUp(Sender: TObject; Button: TMouseButton;
                            Shift: TShiftState; X, Y: Integer);
      procedure CreateLabel(var Lbl: TStaticText;
                                X,Y,W,H: Integer;
                                BorderStyle: TStaticBorderStyle;
                                Color,FontColor: TColor;
                                FontStyle: TFontStyles;
                                Capt: String;
                                Align: TAlignment;
                                FontSize: Integer);
  end;

constructor TMySpecialDay.NCreate ( how: TCreateIt );
Begin
  // Erstellen
  Create (f_planer.sKalender);
  Parent := f_planer.sKalender;
  INC (mySDCount);

  // Konfigurieren
  msdID := how._ID;
  msdState := how.State;
  msdInfo.msdDay := how._Date;
  msdInfo.msdWDay := f_planer.daytoStr(DayOfTheWeek(how._Date));
  msdInfo.msdPerson := how._Caption;
  msdInfo.msdPersonNr := how.Person;
  msdCoords := how.Coords;
  Case msdState of
    msdDontUse : begin
                      Brush.Color := mscDontUse;
                    end;
  end;

  // Ausrichten
  SetBounds(how.Left, how.top, msdWidth, msdHeight);

  // Methoden und Ereignisse anhängen
  if msdState <> msdDontUse then
  Begin
    OnMouseDown := onMyMouseDown;
    OnMouseMove := onMyMouseMove;
    OnMouseUp := onMyMouseUp;
    msdChanged := False;
    msdSelected := False;
  End;
End;

destructor TMySpecialDay.Destroy;
Begin
  Inherited Destroy;
End;
vielleicht hilft das ja auch noch weiter.

mfg, Mika
:: don't Panic ::
  Mit Zitat antworten Zitat