06-01-2021, Saat: 15:24
Merhaba,
programlarında böyle bir şeye ihtiyacı olur mu birinin emin değilim ama hazır yaptım paylaşayım dedim
[attachment=1551]
Segment tasarım
Kod bloğu
[attachment=1553]
programlarında böyle bir şeye ihtiyacı olur mu birinin emin değilim ama hazır yaptım paylaşayım dedim
[attachment=1551]
Segment tasarım
object GridPanelLayout1: TGridPanelLayout Padding.Left = 10.000000000000000000 Padding.Right = 10.000000000000000000 Position.X = 72.000000000000000000 Position.Y = 184.000000000000000000 Size.Width = 200.000000000000000000 Size.Height = 300.000000000000000000 Size.PlatformDefault = False TabOrder = 0 ColumnCollection = < item Value = 100.000000000000000000 end> ControlCollection = < item Column = 0 Control = ustkatman_rec Row = 0 end item Column = 0 Control = altkatman_rec Row = 1 end> RowCollection = < item Value = 55.003304301760790000 end item Value = 44.996695698239210000 end item SizeStyle = Auto end> object ustkatman_rec: TRectangle Align = Client Fill.Kind = None Size.Width = 180.000000000000000000 Size.Height = 165.009918212890600000 Size.PlatformDefault = False Stroke.Kind = None object rec1: TRectangle Align = Top CornerType = Bevel Fill.Color = xFF353C46 Margins.Left = 20.000000000000000000 Margins.Right = 20.000000000000000000 Position.X = 20.000000000000000000 Size.Width = 140.000000000000000000 Size.Height = 40.000000000000000000 Size.PlatformDefault = False Stroke.Kind = None XRadius = 20.000000000000000000 YRadius = 20.000000000000000000 end object rec3: TRectangle Align = Bottom CornerType = Bevel Fill.Color = xFF353C46 Margins.Left = 20.000000000000000000 Margins.Right = 20.000000000000000000 Position.X = 20.000000000000000000 Position.Y = 125.009918212890600000 Size.Width = 140.000000000000000000 Size.Height = 40.000000000000000000 Size.PlatformDefault = False Stroke.Kind = None XRadius = 20.000000000000000000 YRadius = 20.000000000000000000 end object rec4: TRectangle Align = Left CornerType = Bevel Fill.Color = xFF353C46 Margins.Top = -15.000000000000000000 Margins.Bottom = -15.000000000000000000 Position.Y = 25.000000000000000000 Size.Width = 40.000000000000000000 Size.Height = 115.009918212890600000 Size.PlatformDefault = False Stroke.Kind = None XRadius = 20.000000000000000000 YRadius = 20.000000000000000000 end object rec2: TRectangle Align = Right CornerType = Bevel Fill.Color = claAliceblue Margins.Top = -15.000000000000000000 Margins.Bottom = -15.000000000000000000 Position.X = 140.000000000000000000 Position.Y = 25.000000000000000000 Size.Width = 40.000000000000000000 Size.Height = 115.009918212890600000 Size.PlatformDefault = False Stroke.Kind = None XRadius = 20.000000000000000000 YRadius = 20.000000000000000000 end end object altkatman_rec: TRectangle Align = Client Fill.Kind = None Size.Width = 180.000000000000000000 Size.Height = 134.990081787109400000 Size.PlatformDefault = False Stroke.Kind = None object rec6: TRectangle Align = Bottom CornerType = Bevel Fill.Color = xFF353C46 Margins.Left = 20.000000000000000000 Margins.Right = 20.000000000000000000 Position.X = 20.000000000000000000 Position.Y = 94.990081787109380000 Size.Width = 140.000000000000000000 Size.Height = 40.000000000000000000 Size.PlatformDefault = False Stroke.Kind = None XRadius = 20.000000000000000000 YRadius = 20.000000000000000000 end object rec5: TRectangle Align = Left CornerType = Bevel Fill.Color = xFF353C46 Margins.Top = -15.000000000000000000 Margins.Bottom = -15.000000000000000000 Position.Y = -15.000000000000000000 Size.Width = 40.000000000000000000 Size.Height = 124.990081787109400000 Size.PlatformDefault = False Stroke.Kind = None XRadius = 20.000000000000000000 YRadius = 20.000000000000000000 end object rec7: TRectangle Align = Right CornerType = Bevel Fill.Color = claAliceblue Margins.Top = -15.000000000000000000 Margins.Bottom = -15.000000000000000000 Position.X = 140.000000000000000000 Position.Y = -15.000000000000000000 Size.Width = 40.000000000000000000 Size.Height = 124.990081787109400000 Size.PlatformDefault = False Stroke.Kind = None XRadius = 20.000000000000000000 YRadius = 20.000000000000000000 end end end
Kod bloğu
procedure TForm1.SetNumaraOlustur(const Numara: Integer); var I, j: Integer; rct: TRectangle; function GetRectangleNameToLastNumber(): Integer; var k: Integer; No: String; begin No := EmptyStr; for k := 1 to Length(rct.Name) do if IsDigit(rct.Name[k]) then No := No + rct.Name[k]; Result := StrToInt(No); end; begin for I := 0 to GridPanelLayout1.Controls.Count - 1 do for j := 0 to GridPanelLayout1.Controls[i].ChildrenCount - 1 do if GridPanelLayout1.Controls[i].Children[j] is TRectangle then begin rct := TRectangle(GridPanelLayout1.Controls[i].Children[j]); case Numara of 0: if not(GetRectangleNameToLastNumber in [1, 3, 4, 5, 6]) then rct.Fill.Color := TAlphaColorRec.Aliceblue; 1: if not(GetRectangleNameToLastNumber in [1, 3, 4, 5, 6]) then rct.Fill.Color := TAlphaColorRec.Aliceblue; 2: if not(GetRectangleNameToLastNumber in [4, 7]) then rct.Fill.Color := TAlphaColorRec.Aliceblue; 3: if not(GetRectangleNameToLastNumber in [4, 5]) then rct.Fill.Color := TAlphaColorRec.Aliceblue; 4: if not(GetRectangleNameToLastNumber in [1, 5, 6]) then rct.Fill.Color := TAlphaColorRec.Aliceblue; 5: if not(GetRectangleNameToLastNumber in [2, 5]) then rct.Fill.Color := TAlphaColorRec.Aliceblue; 6: if not(GetRectangleNameToLastNumber in [2]) then rct.Fill.Color := TAlphaColorRec.Aliceblue; 7: if not(GetRectangleNameToLastNumber in [3, 4, 5, 6]) then rct.Fill.Color := TAlphaColorRec.Aliceblue; 8: if not(GetRectangleNameToLastNumber in []) then rct.Fill.Color := TAlphaColorRec.Aliceblue; 9: if not(GetRectangleNameToLastNumber in [5]) then rct.Fill.Color := TAlphaColorRec.Aliceblue; end; end; end; procedure TForm1.goster_recClick(Sender: TObject); var I, j: Integer; begin for I := 0 to GridPanelLayout1.Controls.Count - 1 do for j := 0 to GridPanelLayout1.Controls[i].ChildrenCount - 1 do if GridPanelLayout1.Controls[i].Children[j] is TRectangle then TRectangle(GridPanelLayout1.Controls[i].Children[j]).Fill.Color := renk_rec.Fill.Color; SetNumaraOlustur(Edit1.Text.ToInteger); end;
[attachment=1553]