Browse Source

* goptions removed
* small patches from antonio talamini

peter 20 years ago
parent
commit
fbb6b1c6fe
2 changed files with 22 additions and 40 deletions
  1. 14 17
      fv/dialogs.pas
  2. 8 23
      fv/views.pas

+ 14 - 17
fv/dialogs.pas

@@ -1290,11 +1290,9 @@ BEGIN
    S.Read(W, sizeof(w)); SelStart:=w;                 { Read selected start }
    S.Read(W, sizeof(w)); SelStart:=w;                 { Read selected start }
    S.Read(W, sizeof(w)); SelEnd:=w;                   { Read selected end }
    S.Read(W, sizeof(w)); SelEnd:=w;                   { Read selected end }
    S.Read(B, SizeOf(B));                              { Read string length }
    S.Read(B, SizeOf(B));                              { Read string length }
-   If (MaxAvail > MaxLen+1) Then Begin                { Check enough memory }
-     GetMem(Data, MaxLen + 1);                        { Allocate memory }
-     S.Read(Data^[1], Length(Data^));                 { Read string data }
-     SetLength(Data^, B);                             { Xfer string length }
-   End Else S.Seek(S.GetPos + B);                     { Move to position }
+   GetMem(Data, B + 1);                        { Allocate memory }
+   S.Read(Data^[1], B);                             { Read string data }
+   SetLength(Data^, B);                             { Xfer string length }
    If (Options AND ofVersion >= ofVersion20) Then     { Version 2 or above }
    If (Options AND ofVersion >= ofVersion20) Then     { Version 2 or above }
      Validator := PValidator(S.Get);                  { Get any validator }
      Validator := PValidator(S.Get);                  { Get any validator }
    Options := Options OR ofVersion20;                 { Set version 2 flag }
    Options := Options OR ofVersion20;                 { Set version 2 flag }
@@ -2164,8 +2162,7 @@ BEGIN
    CNorm := GetColor($0301);                          { Normal colour }
    CNorm := GetColor($0301);                          { Normal colour }
    CSel := GetColor($0402);                           { Selected colour }
    CSel := GetColor($0402);                           { Selected colour }
    CDis := GetColor($0505);                           { Disabled colour }
    CDis := GetColor($0505);                           { Disabled colour }
-   If (Options AND ofFramed <>0) OR                   { Normal frame }
-   (GOptions AND goThickFramed <>0) Then              { Thick frame }
+   If (Options AND ofFramed <>0) Then              { Thick frame }
      K := 1 Else  K := 0;                             { Select offset }
      K := 1 Else  K := 0;                             { Select offset }
    For I := 0 To Size.Y-K-K-1 Do Begin                { For each line }
    For I := 0 To Size.Y-K-K-1 Do Begin                { For each line }
      MoveChar(B, ' ', Byte(CNorm), Size.X-K-K);       { Fill buffer }
      MoveChar(B, ' ', Byte(CNorm), Size.X-K-K);       { Fill buffer }
@@ -2305,8 +2302,7 @@ BEGIN
      End;
      End;
      ClearEvent(Event);                               { Event was handled }
      ClearEvent(Event);                               { Event was handled }
    End Else If (Event.What = evKeyDown) Then Begin    { KEY EVENT }
    End Else If (Event.What = evKeyDown) Then Begin    { KEY EVENT }
-     If (Options AND ofFramed <> 0) OR                { Normal frame }
-     (GOptions AND goThickFramed <> 0) Then           { Thick frame }
+     If (Options AND ofFramed <> 0) Then           { Thick frame }
        J := 1 Else J := 0;                            { Adjust value }
        J := 1 Else J := 0;                            { Adjust value }
      Vh := Size.Y - J - J;                            { View height }
      Vh := Size.Y - J - J;                            { View height }
      S := Sel;                                        { Hold current item }
      S := Sel;                                        { Hold current item }
@@ -2383,8 +2379,7 @@ VAR I, J, S, Vh: Sw_Integer; R: TRect;
 BEGIN
 BEGIN
    GetExtent(R);                                      { Get view extents }
    GetExtent(R);                                      { Get view extents }
    If R.Contains(P) Then Begin                        { Point in view }
    If R.Contains(P) Then Begin                        { Point in view }
-     If (Options AND ofFramed <> 0) OR                { Normal frame }
-     (GOptions AND goThickFramed <> 0) Then           { Thick frame }
+     If (Options AND ofFramed <> 0) Then           { Thick frame }
        J := 1 Else J := 0;                            { Adjust value }
        J := 1 Else J := 0;                            { Adjust value }
      Vh := Size.Y - J - J;                            { View height }
      Vh := Size.Y - J - J;                            { View height }
      I := 0;                                          { Preset zero value }
      I := 0;                                          { Preset zero value }
@@ -2400,8 +2395,7 @@ END;
 {---------------------------------------------------------------------------}
 {---------------------------------------------------------------------------}
 FUNCTION TCluster.Row (Item: Sw_Integer): Sw_Integer;
 FUNCTION TCluster.Row (Item: Sw_Integer): Sw_Integer;
 BEGIN
 BEGIN
-   If (Options AND ofFramed <> 0) OR                  { Normal frame }
-  (GOptions AND goThickFramed <> 0) Then              { Thick frame }
+   If (Options AND ofFramed <> 0) Then              { Thick frame }
     Row := Item MOD (Size.Y - 2) Else                 { Allow for frames }
     Row := Item MOD (Size.Y - 2) Else                 { Allow for frames }
     Row := Item MOD Size.Y;                           { Normal mod value }
     Row := Item MOD Size.Y;                           { Normal mod value }
 END;
 END;
@@ -2412,8 +2406,7 @@ END;
 FUNCTION TCluster.Column (Item: Sw_Integer): Sw_Integer;
 FUNCTION TCluster.Column (Item: Sw_Integer): Sw_Integer;
 VAR I, J, Col, Width, L, Vh: Sw_Integer; Ts: PString;
 VAR I, J, Col, Width, L, Vh: Sw_Integer; Ts: PString;
 BEGIN
 BEGIN
-   If (Options AND ofFramed <> 0) OR                  { Normal frame }
-   (GOptions AND goThickFramed <> 0) Then             { Thick frame }
+   If (Options AND ofFramed <> 0) Then             { Thick frame }
      J := 1 Else J := 0;                              { Adjust value }
      J := 1 Else J := 0;                              { Adjust value }
    Vh := Size.Y - J - J;                              { Vertical size }
    Vh := Size.Y - J - J;                              { Vertical size }
    If (Item >= Vh) Then Begin                         { Valid selection }
    If (Item >= Vh) Then Begin                         { Valid selection }
@@ -2633,7 +2626,7 @@ END;
 TYPE
 TYPE
    TListBoxRec = PACKED RECORD
    TListBoxRec = PACKED RECORD
      List: PCollection;                               { List collection ptr }
      List: PCollection;                               { List collection ptr }
-     Selection: Word;                                 { Selected item }
+     Selection: sw_integer;                           { Selected item }
    END;
    END;
 
 
 {--TListBox-----------------------------------------------------------------}
 {--TListBox-----------------------------------------------------------------}
@@ -4158,7 +4151,11 @@ END;
 END.
 END.
 {
 {
  $Log$
  $Log$
- Revision 1.28  2004-11-06 23:24:36  peter
+ Revision 1.29  2004-12-15 19:14:11  peter
+   * goptions removed
+   * small patches from antonio talamini
+
+ Revision 1.28  2004/11/06 23:24:36  peter
    * fixed button click
    * fixed button click
 
 
  Revision 1.27  2004/11/06 17:08:48  peter
  Revision 1.27  2004/11/06 17:08:48  peter

+ 8 - 23
fv/views.pas

@@ -122,16 +122,6 @@ CONST
    dmLimitHiY = $80;                                  { Limit bottom side }
    dmLimitHiY = $80;                                  { Limit bottom side }
    dmLimitAll = $F0;                                  { Limit all sides }
    dmLimitAll = $F0;                                  { Limit all sides }
 
 
-{---------------------------------------------------------------------------}
-{                      >> NEW << TView OPTION MASKS                         }
-{---------------------------------------------------------------------------}
-CONST
-   goThickFramed = $0001;                             { Thick framed mask }
-   goTabSelect   = $0002;                             { Tab selectable }
-   goEveryKey    = $0004;                             { Report every key }
-   goEndModal    = $0008;                             { End modal }
-   goNativeClass = $4000;                             { Native class window }
-
 {---------------------------------------------------------------------------}
 {---------------------------------------------------------------------------}
 {                       >> NEW << TAB OPTION MASKS                          }
 {                       >> NEW << TAB OPTION MASKS                          }
 {---------------------------------------------------------------------------}
 {---------------------------------------------------------------------------}
@@ -335,7 +325,6 @@ TYPE
          State    : Word;                             { View state masks }
          State    : Word;                             { View state masks }
          Options  : Word;                             { View options masks }
          Options  : Word;                             { View options masks }
          EventMask: Word;                             { View event masks }
          EventMask: Word;                             { View event masks }
-         GOptions : Word;                             { Graphics options }
          Origin   : TPoint;                           { View origin }
          Origin   : TPoint;                           { View origin }
          Size     : TPoint;                           { View size }
          Size     : TPoint;                           { View size }
          Cursor   : TPoint;                           { Cursor position }
          Cursor   : TPoint;                           { Cursor position }
@@ -952,7 +941,6 @@ BEGIN
    HelpCtx := hcNoContext;                            { Clear help context }
    HelpCtx := hcNoContext;                            { Clear help context }
    State := sfVisible;                                { Default state }
    State := sfVisible;                                { Default state }
    EventMask := evMouseDown + evKeyDown + evCommand;  { Default event masks }
    EventMask := evMouseDown + evKeyDown + evCommand;  { Default event masks }
-   GOptions := goTabSelect;                           { Set new options }
    BackgroundChar := ' ';
    BackgroundChar := ' ';
    SetBounds(Bounds);                                 { Set view bounds }
    SetBounds(Bounds);                                 { Set view bounds }
 END;
 END;
@@ -1930,7 +1918,6 @@ BEGIN
    Options := Options OR (ofSelectable + ofBuffered); { Set options }
    Options := Options OR (ofSelectable + ofBuffered); { Set options }
    GetExtent(Clip);                                   { Get clip extents }
    GetExtent(Clip);                                   { Get clip extents }
    EventMask := $FFFF;                                { See all events }
    EventMask := $FFFF;                                { See all events }
-   GOptions := GOptions OR goTabSelect;               { Set graphic options }
 END;
 END;
 
 
 {--TGroup-------------------------------------------------------------------}
 {--TGroup-------------------------------------------------------------------}
@@ -2505,7 +2492,7 @@ END;
 {  GetSubViewPtr -> Platforms DOS/DPMI/WIN/NT/OS2 - Updated 20May98 LdB     }
 {  GetSubViewPtr -> Platforms DOS/DPMI/WIN/NT/OS2 - Updated 20May98 LdB     }
 {---------------------------------------------------------------------------}
 {---------------------------------------------------------------------------}
 PROCEDURE TGroup.GetSubViewPtr (Var S: TStream; Var P);
 PROCEDURE TGroup.GetSubViewPtr (Var S: TStream; Var P);
-VAR Index, I: Word; Q: PView;
+VAR Index, I: Sw_Word; Q: PView;
 BEGIN
 BEGIN
    Index := 0;                                        { Zero index value }
    Index := 0;                                        { Zero index value }
    S.Read(Index, SizeOf(Index));                      { Read view index }
    S.Read(Index, SizeOf(Index));                      { Read view index }
@@ -2561,9 +2548,8 @@ BEGIN
      Repeat
      Repeat
        If Forwards Then P := P^.Next                  { Get next view }
        If Forwards Then P := P^.Next                  { Get next view }
          Else P := P^.Prev;                           { Get prev view }
          Else P := P^.Prev;                           { Get prev view }
-     Until ((P^.State AND (sfVisible+sfDisabled) = sfVisible)
-     AND ((P^.Options AND ofSelectable <> 0) AND      { Selectable }
-     (P^.GOptions AND goTabSelect <> 0))) OR          { Tab selectable }
+     Until ((P^.State AND (sfVisible+sfDisabled) = sfVisible) AND
+            (P^.Options AND ofSelectable <> 0)) OR          { Tab selectable }
      (P = Current);                                   { Not singular select }
      (P = Current);                                   { Not singular select }
      If (P <> Current) Then FindNext := P;            { Return result }
      If (P <> Current) Then FindNext := P;            { Return result }
    End;
    End;
@@ -3744,7 +3730,6 @@ BEGIN
    Title := NewStr(ATitle);                           { Hold title }
    Title := NewStr(ATitle);                           { Hold title }
    Number := ANumber;                                 { Hold number }
    Number := ANumber;                                 { Hold number }
    Palette := wpBlueWindow;                           { Default palette }
    Palette := wpBlueWindow;                           { Default palette }
-   GOptions := GOptions OR goThickFramed;             { Thick frame }
    InitFrame;                                         { Initialize frame }
    InitFrame;                                         { Initialize frame }
    If (Frame <> Nil) Then Insert(Frame);              { Insert any frame }
    If (Frame <> Nil) Then Insert(Frame);              { Insert any frame }
    GetBounds(ZoomRect);                               { Default zoom rect }
    GetBounds(ZoomRect);                               { Default zoom rect }
@@ -3768,10 +3753,6 @@ BEGIN
    S.Read(i, SizeOf(i)); ZoomRect.B.X:=i;                          { Read zoom area x2 }
    S.Read(i, SizeOf(i)); ZoomRect.B.X:=i;                          { Read zoom area x2 }
    S.Read(i, SizeOf(i)); ZoomRect.B.Y:=i;                          { Read zoom area y2 }
    S.Read(i, SizeOf(i)); ZoomRect.B.Y:=i;                          { Read zoom area y2 }
    GetSubViewPtr(S, Frame);                           { Now read frame object }
    GetSubViewPtr(S, Frame);                           { Now read frame object }
-   If (Frame <> Nil) Then Begin
-     Dispose(Frame, Done);                            { Kill we don't use it }
-     Frame := Nil;                                    { Clear the pointer }
-   End;
    Title := S.ReadStr;                                { Read title }
    Title := S.ReadStr;                                { Read title }
 END;
 END;
 
 
@@ -4639,7 +4620,11 @@ END.
 
 
 {
 {
  $Log$
  $Log$
- Revision 1.50  2004-11-24 21:03:05  florian
+ Revision 1.51  2004-12-15 19:14:11  peter
+   * goptions removed
+   * small patches from antonio talamini
+
+ Revision 1.50  2004/11/24 21:03:05  florian
    * increased max. possible screen/view width to 255
    * increased max. possible screen/view width to 255
 
 
  Revision 1.49  2004/11/06 23:24:37  peter
  Revision 1.49  2004/11/06 23:24:37  peter