diff --git a/components/industrialstuff/resources/black.png b/components/industrialstuff/resources/black.png index 183962457..f7b5605de 100644 Binary files a/components/industrialstuff/resources/black.png and b/components/industrialstuff/resources/black.png differ diff --git a/components/industrialstuff/resources/black_150.png b/components/industrialstuff/resources/black_150.png new file mode 100644 index 000000000..7511f5e4d Binary files /dev/null and b/components/industrialstuff/resources/black_150.png differ diff --git a/components/industrialstuff/resources/black_200.png b/components/industrialstuff/resources/black_200.png new file mode 100644 index 000000000..06f469997 Binary files /dev/null and b/components/industrialstuff/resources/black_200.png differ diff --git a/components/industrialstuff/resources/bulbdisabled.png b/components/industrialstuff/resources/bulbdisabled.png new file mode 100644 index 000000000..75b154297 Binary files /dev/null and b/components/industrialstuff/resources/bulbdisabled.png differ diff --git a/components/industrialstuff/resources/bulbdisabled_150.png b/components/industrialstuff/resources/bulbdisabled_150.png new file mode 100644 index 000000000..e16a6f55b Binary files /dev/null and b/components/industrialstuff/resources/bulbdisabled_150.png differ diff --git a/components/industrialstuff/resources/bulbdisabled_200.png b/components/industrialstuff/resources/bulbdisabled_200.png new file mode 100644 index 000000000..c37f3f84d Binary files /dev/null and b/components/industrialstuff/resources/bulbdisabled_200.png differ diff --git a/components/industrialstuff/resources/bulboff.png b/components/industrialstuff/resources/bulboff.png new file mode 100644 index 000000000..649e8056f Binary files /dev/null and b/components/industrialstuff/resources/bulboff.png differ diff --git a/components/industrialstuff/resources/bulboff.xpm b/components/industrialstuff/resources/bulboff.xpm deleted file mode 100644 index 79195063c..000000000 --- a/components/industrialstuff/resources/bulboff.xpm +++ /dev/null @@ -1,34 +0,0 @@ -/* XPM */ -static char * LEDBULBOFF[] = { -"15 15 16 1", -" c #000000", -". c #800000", -"+ c #008000", -"@ c #808000", -"# c #000080", -"$ c #800080", -"% c #008080", -"& c #808080", -"* c #C0C0C0", -"= c #FF0000", -"- c #00FF00", -"; c #FFFF00", -"> c #0000FF", -", c #FF00FF", -"' c #00FFFF", -") c #FFFFFF", -"@@@@@@@@@@@@@@@", -"@@@@@@@@@@@@@@@", -"@@@@@@@@@@@@@@@", -"@@@@@@@@@@@@@@@", -"@@@@@@ @@@@@@", -"@@@@@ ))) @@@@@", -"@@@@ ))))) @@@@", -"@@@@ ))&)) @@@@", -"@@@@ ))&)) @@@@", -"@@@@@ )&) @@@@@", -"@@@@@@ ) @@@@@@", -"@@@@@@ ) @@@@@@", -"@@@@@@ @@@@@@", -"@@@@@@ * @@@@@@", -"@@@@@@ @@@@@@"}; diff --git a/components/industrialstuff/resources/bulboff_150.png b/components/industrialstuff/resources/bulboff_150.png new file mode 100644 index 000000000..df20f0cb3 Binary files /dev/null and b/components/industrialstuff/resources/bulboff_150.png differ diff --git a/components/industrialstuff/resources/bulboff_200.png b/components/industrialstuff/resources/bulboff_200.png new file mode 100644 index 000000000..2a77caf32 Binary files /dev/null and b/components/industrialstuff/resources/bulboff_200.png differ diff --git a/components/industrialstuff/resources/bulbon.png b/components/industrialstuff/resources/bulbon.png new file mode 100644 index 000000000..9a4ae6f57 Binary files /dev/null and b/components/industrialstuff/resources/bulbon.png differ diff --git a/components/industrialstuff/resources/bulbon.xpm b/components/industrialstuff/resources/bulbon.xpm deleted file mode 100644 index 03b48d3c9..000000000 --- a/components/industrialstuff/resources/bulbon.xpm +++ /dev/null @@ -1,34 +0,0 @@ -/* XPM */ -static char * LEDBULBON[] = { -"15 15 16 1", -" c #000000", -". c #800000", -"+ c #008000", -"@ c #808000", -"# c #000080", -"$ c #800080", -"% c #008080", -"& c #808080", -"* c #C0C0C0", -"= c #FF0000", -"- c #00FF00", -"; c #FFFF00", -"> c #0000FF", -", c #FF00FF", -"' c #00FFFF", -") c #FFFFFF", -"@@@@@@@;@@@@@@@", -"@@@@@@@;@@@@@@@", -"@@;@@;;;;;@@;@@", -"@@@;;;;;;;;;@@@", -"@@@;;; ;;;@@@", -"@@;;; );) ;;;@@", -"@@;; ););) ;;@@", -";;;; ;)&); ;;;;", -"@@;; );&;) ;;@@", -"@@;;; )&) ;;;@@", -"@@@;;; ) ;;;@@@", -"@@@;;; ; ;;;@@@", -"@@;@@; ;@@;@@", -"@@@@@@ * @@@@@@", -"@@@@@@ @@@@@@"}; diff --git a/components/industrialstuff/resources/bulbon_150.png b/components/industrialstuff/resources/bulbon_150.png new file mode 100644 index 000000000..a1767ce9a Binary files /dev/null and b/components/industrialstuff/resources/bulbon_150.png differ diff --git a/components/industrialstuff/resources/bulbon_200.png b/components/industrialstuff/resources/bulbon_200.png new file mode 100644 index 000000000..0a8846158 Binary files /dev/null and b/components/industrialstuff/resources/bulbon_200.png differ diff --git a/components/industrialstuff/resources/green.png b/components/industrialstuff/resources/green.png index 2a20ee074..9c679414d 100644 Binary files a/components/industrialstuff/resources/green.png and b/components/industrialstuff/resources/green.png differ diff --git a/components/industrialstuff/resources/green_150.png b/components/industrialstuff/resources/green_150.png new file mode 100644 index 000000000..e4bbd09d9 Binary files /dev/null and b/components/industrialstuff/resources/green_150.png differ diff --git a/components/industrialstuff/resources/green_200.png b/components/industrialstuff/resources/green_200.png new file mode 100644 index 000000000..74f79e14c Binary files /dev/null and b/components/industrialstuff/resources/green_200.png differ diff --git a/components/industrialstuff/resources/greenoff.png b/components/industrialstuff/resources/greenoff.png new file mode 100644 index 000000000..d9a8bf773 Binary files /dev/null and b/components/industrialstuff/resources/greenoff.png differ diff --git a/components/industrialstuff/resources/greenoff_150.png b/components/industrialstuff/resources/greenoff_150.png new file mode 100644 index 000000000..37d33cc3a Binary files /dev/null and b/components/industrialstuff/resources/greenoff_150.png differ diff --git a/components/industrialstuff/resources/greenoff_200.png b/components/industrialstuff/resources/greenoff_200.png new file mode 100644 index 000000000..15c930cc6 Binary files /dev/null and b/components/industrialstuff/resources/greenoff_200.png differ diff --git a/components/industrialstuff/resources/industrial_icons.txt b/components/industrialstuff/resources/industrial_icons.txt index 2b2581155..92b4f8fec 100644 --- a/components/industrialstuff/resources/industrial_icons.txt +++ b/components/industrialstuff/resources/industrial_icons.txt @@ -1,9 +1,15 @@ tadvled.png +tadvled_150.png +tadvled_200.png tanalogsensor.png tindgnoumeter.png tindled.png tlednumber.png +tlednumber_150.png +tlednumber_200.png tstoplightsensor.png +tstoplightsensor_150.png +tstoplightsensor_200.png ta3naloggauge.png ta3naloggauge_150.png ta3naloggauge_200.png diff --git a/components/industrialstuff/resources/ledbuttons.txt b/components/industrialstuff/resources/ledbuttons.txt index 382ab3a71..78f0361ae 100644 --- a/components/industrialstuff/resources/ledbuttons.txt +++ b/components/industrialstuff/resources/ledbuttons.txt @@ -1,6 +1,30 @@ black.png +black_150.png +black_200.png green.png +green_150.png +green_200.png red.png +red_150.png +red_200.png yellow.png -bulboff.xpm -bulbon.xpm +yellow_150.png +yellow_200.png +bulboff.png +bulboff_150.png +bulboff_200.png +bulbon.png +bulbon_150.png +bulbon_200.png +greenoff.png +greenoff_150.png +greenoff_200.png +redoff.png +redoff_150.png +redoff_200.png +yellowoff.png +yellowoff_150.png +yellowoff_200.png +bulbdisabled.png +bulbdisabled_150.png +bulbdisabled_200.png \ No newline at end of file diff --git a/components/industrialstuff/resources/red.png b/components/industrialstuff/resources/red.png index 40081a2e0..f4ff32271 100644 Binary files a/components/industrialstuff/resources/red.png and b/components/industrialstuff/resources/red.png differ diff --git a/components/industrialstuff/resources/red_150.png b/components/industrialstuff/resources/red_150.png new file mode 100644 index 000000000..2efd0c48e Binary files /dev/null and b/components/industrialstuff/resources/red_150.png differ diff --git a/components/industrialstuff/resources/red_200.png b/components/industrialstuff/resources/red_200.png new file mode 100644 index 000000000..630c14760 Binary files /dev/null and b/components/industrialstuff/resources/red_200.png differ diff --git a/components/industrialstuff/resources/redoff.png b/components/industrialstuff/resources/redoff.png new file mode 100644 index 000000000..563c4c21e Binary files /dev/null and b/components/industrialstuff/resources/redoff.png differ diff --git a/components/industrialstuff/resources/redoff_150.png b/components/industrialstuff/resources/redoff_150.png new file mode 100644 index 000000000..976ba070b Binary files /dev/null and b/components/industrialstuff/resources/redoff_150.png differ diff --git a/components/industrialstuff/resources/redoff_200.png b/components/industrialstuff/resources/redoff_200.png new file mode 100644 index 000000000..50d515004 Binary files /dev/null and b/components/industrialstuff/resources/redoff_200.png differ diff --git a/components/industrialstuff/resources/tadvled.png b/components/industrialstuff/resources/tadvled.png index 2a20ee074..9c679414d 100644 Binary files a/components/industrialstuff/resources/tadvled.png and b/components/industrialstuff/resources/tadvled.png differ diff --git a/components/industrialstuff/resources/tadvled_150.png b/components/industrialstuff/resources/tadvled_150.png new file mode 100644 index 000000000..e4bbd09d9 Binary files /dev/null and b/components/industrialstuff/resources/tadvled_150.png differ diff --git a/components/industrialstuff/resources/tadvled_200.png b/components/industrialstuff/resources/tadvled_200.png new file mode 100644 index 000000000..74f79e14c Binary files /dev/null and b/components/industrialstuff/resources/tadvled_200.png differ diff --git a/components/industrialstuff/resources/tlednumber.png b/components/industrialstuff/resources/tlednumber.png index 02be83846..93d88b713 100644 Binary files a/components/industrialstuff/resources/tlednumber.png and b/components/industrialstuff/resources/tlednumber.png differ diff --git a/components/industrialstuff/resources/tlednumber_150.png b/components/industrialstuff/resources/tlednumber_150.png new file mode 100644 index 000000000..4eab90afa Binary files /dev/null and b/components/industrialstuff/resources/tlednumber_150.png differ diff --git a/components/industrialstuff/resources/tlednumber_200.png b/components/industrialstuff/resources/tlednumber_200.png new file mode 100644 index 000000000..abc7a94ff Binary files /dev/null and b/components/industrialstuff/resources/tlednumber_200.png differ diff --git a/components/industrialstuff/resources/tstoplightsensor.png b/components/industrialstuff/resources/tstoplightsensor.png index d7c60a1f1..bc6b25b33 100644 Binary files a/components/industrialstuff/resources/tstoplightsensor.png and b/components/industrialstuff/resources/tstoplightsensor.png differ diff --git a/components/industrialstuff/resources/tstoplightsensor_150.png b/components/industrialstuff/resources/tstoplightsensor_150.png new file mode 100644 index 000000000..994ebd929 Binary files /dev/null and b/components/industrialstuff/resources/tstoplightsensor_150.png differ diff --git a/components/industrialstuff/resources/tstoplightsensor_200.png b/components/industrialstuff/resources/tstoplightsensor_200.png new file mode 100644 index 000000000..84b2ebd30 Binary files /dev/null and b/components/industrialstuff/resources/tstoplightsensor_200.png differ diff --git a/components/industrialstuff/resources/yellow.png b/components/industrialstuff/resources/yellow.png index a801b5d05..435f259d9 100644 Binary files a/components/industrialstuff/resources/yellow.png and b/components/industrialstuff/resources/yellow.png differ diff --git a/components/industrialstuff/resources/yellow_150.png b/components/industrialstuff/resources/yellow_150.png new file mode 100644 index 000000000..c735dbda6 Binary files /dev/null and b/components/industrialstuff/resources/yellow_150.png differ diff --git a/components/industrialstuff/resources/yellow_200.png b/components/industrialstuff/resources/yellow_200.png new file mode 100644 index 000000000..7d4a38069 Binary files /dev/null and b/components/industrialstuff/resources/yellow_200.png differ diff --git a/components/industrialstuff/resources/yellowoff.png b/components/industrialstuff/resources/yellowoff.png new file mode 100644 index 000000000..2e8eb42f2 Binary files /dev/null and b/components/industrialstuff/resources/yellowoff.png differ diff --git a/components/industrialstuff/resources/yellowoff_150.png b/components/industrialstuff/resources/yellowoff_150.png new file mode 100644 index 000000000..dfdcf9037 Binary files /dev/null and b/components/industrialstuff/resources/yellowoff_150.png differ diff --git a/components/industrialstuff/resources/yellowoff_200.png b/components/industrialstuff/resources/yellowoff_200.png new file mode 100644 index 000000000..725702965 Binary files /dev/null and b/components/industrialstuff/resources/yellowoff_200.png differ diff --git a/components/industrialstuff/source/AdvLed.pas b/components/industrialstuff/source/AdvLed.pas index 639cd66fa..6628ec45a 100644 --- a/components/industrialstuff/source/AdvLed.pas +++ b/components/industrialstuff/source/AdvLed.pas @@ -56,6 +56,8 @@ type protected FlipFLop : Boolean; + procedure DoAutoAdjustLayout(const AMode: TLayoutAdjustmentPolicy; + const AXProportion, AYProportion: Double); override; procedure DoChange(AState: TLedState); dynamic; procedure Loaded; override; public @@ -181,16 +183,17 @@ begin inherited; if FKind <> lkCustom then BitmapNeeded; - { +end; - Try - If (csDesigning in ComponentState) Then Exit ; - // Load Bitmap if necessary - BitmapNeeded; - Finally - inherited Loaded; - End; - } +procedure TAdvLed.DoAutoAdjustLayout( + const AMode: TLayoutAdjustmentPolicy; + const AXProportion, AYProportion: Double); +begin + inherited DoAutoAdjustLayout(AMode, AXProportion, AYProportion); + if AMode in [lapAutoAdjustWithoutHorizontalScrolling, lapAutoAdjustForDPI] then + begin + BitmapNeeded; + end; end; // timer @@ -231,14 +234,22 @@ const DisabledBitmaps: array[TLedKind] of string = ('LEDREDOFF', 'LEDGREENOFF', 'LEDBLUEOFF', 'LEDYELLOWOFF', 'LEDPURPLEOFF', 'LEDBULBOFF' ,''); } OnBitmaps: array[TLedKind] of string = ('RED', 'GREEN', 'YELLOW', 'BULBON', ''); - OffBitmaps: array[TLedKind] of string = ('BLACK', 'BLACK', 'BLACK','BULBOFF', ''); - DisabledBitmaps: array[TLedKind] of string = ('BLACK', 'BLACK', 'BLACK','BULBOFF' ,''); + OffBitmaps: array[TLedKind] of string = ('REDOFF', 'GREENOFF', 'YELLOWOFF','BULBOFF', ''); + DisabledBitmaps: array[TLedKind] of string = ('BLACK', 'BLACK', 'BLACK','BULBDISABLED' ,''); +var + resName: String; begin if LedKind <> lkCustom then begin - FGlyphs[lsOn].LoadFromResourceName(HInstance, OnBitmaps[LedKind]); - FGlyphs[lsOff].LoadFromResourceName(HInstance, OffBitmaps[LedKind]); - FGlyphs[lsDisabled].LoadFromResourceName(HInstance, DisabledBitmaps[LedKind]); + if Font.PixelsPerInch >=168 then + resName := '_200' + else if Font.PixelsPerInch >= 120 then + resName := '_150' + else + resName := ''; + FGlyphs[lsOn].LoadFromResourceName(HInstance, OnBitmaps[LedKind] + resName); + FGlyphs[lsOff].LoadFromResourceName(HInstance, OffBitmaps[LedKind] + resName); + FGlyphs[lsDisabled].LoadFromResourceName(HInstance, DisabledBitmaps[LedKind] + resName); end; end; diff --git a/components/industrialstuff/source/industrial_icons.res b/components/industrialstuff/source/industrial_icons.res index 31f531958..94f2cdbcb 100644 Binary files a/components/industrialstuff/source/industrial_icons.res and b/components/industrialstuff/source/industrial_icons.res differ diff --git a/components/industrialstuff/source/ledbuttons.res b/components/industrialstuff/source/ledbuttons.res index d47dbcdd3..c4bc98e0d 100644 Binary files a/components/industrialstuff/source/ledbuttons.res and b/components/industrialstuff/source/ledbuttons.res differ diff --git a/components/industrialstuff/source/lednumber.pas b/components/industrialstuff/source/lednumber.pas index e6b66faa7..c04670cd5 100644 --- a/components/industrialstuff/source/lednumber.pas +++ b/components/industrialstuff/source/lednumber.pas @@ -49,12 +49,14 @@ type FScaleFactor: Double; procedure SetBorderStyle(AValue: TLedNumberBorderStyle); procedure SetTransparent(AValue: boolean); + procedure SetZeroToO(AValue: Boolean); protected{private} FBgColor : TColor; FOffColor : TColor; FOnColor : TColor; FColumns : Integer; FRows : Integer; + FZeroToO : Boolean; FSize : TSegmentSize; FSlantAngle: Integer; FSlanted : Boolean; @@ -69,6 +71,7 @@ type procedure PaintSegment(Segment: Integer; TheColor: TColor; Points: array of TPoint; OffsetX, OffsetY: Integer); procedure ResizeControl(Row, Col, ASize: Integer); + procedure SetParent(NewParent: TWinControl); override; function GetAbout: string; function GetSlantAngle: Double; procedure SetAbout(const {%H-}Value: string); @@ -79,7 +82,7 @@ type procedure SetOffColor(Value: TColor); procedure SetRows(Value: Integer); procedure SetColumns(Value: Integer); - procedure SetbgColor(Value: TColor); + procedure SetBGColor(Value: TColor); procedure SelectSegments(Segment: Word; Points: array of TPoint; OffsetX, OffsetY: Integer); protected @@ -96,6 +99,7 @@ type property SlantAngle: Integer read FSlantAngle write SetSlantAngle default 5; property Slanted: Boolean read FSlanted write SetSlanted default false; property Transparent: boolean read FTransparent write SetTransparent default false; {Draws segments with transparent background.BgColor is used as mask color.} + property ZeroToO: Boolean read FZeroToO write SetZeroToO default false; public constructor Create(AOwner:TComponent); override; destructor Destroy; override; @@ -104,6 +108,7 @@ type TLEDNumber = class(TCustomLEDNumber) published property Version; + property BorderSpacing; property BorderStyle; property Caption; property Columns; @@ -127,6 +132,7 @@ type property Slanted; property Transparent; property Visible; + property ZeroToO; end; @@ -235,6 +241,10 @@ const 44, 0, 45, 0, 0, 0, 0, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44); +const + BASE_WIDTH = 17; + BASE_HEIGHT = 30; + {===== TCustomLEDNumber ============================================} @@ -249,14 +259,15 @@ begin csSetCaption, csClickEvents, csDoubleClicks]; - Width := 170; - Height := 30; + FRows := 1; + FColumns := 10; + + Width := FColumns * BASE_WIDTH; + Height := FRows * BASE_HEIGHT; FOnColor := clLime; FOffColor := $000E3432; FBgColor := clBlack; FSize := 2; - FRows := 1; - FColumns := 10; FSlantAngle := 5; Caption := 'LED-LABEL'; lbDrawBmp := TBitmap.Create; @@ -292,6 +303,13 @@ begin Invalidate; end; +procedure TCustomLEDNumber.SetZeroToO(AValue: Boolean); +begin + if FZeroToO = AValue then Exit; + FZeroToO := AValue; + Invalidate; +end; + procedure TCustomLEDNumber.SetBorderStyle(AValue: TLedNumberBorderStyle); begin if FBorderStyle=AValue then Exit; @@ -312,8 +330,6 @@ procedure TCustomLEDNumber.DoAutoAdjustLayout( begin inherited; FScalefactor := Font.PixelsPerInch / 96; - if AMode in [lapAutoAdjustWithoutHorizontalScrolling, lapAutoAdjustForDPI] then - FScaleFactor *= Max(AXProportion, AYProportion) end; procedure TCustomLEDNumber.SlantPoint(var P: TPoint; @@ -336,7 +352,7 @@ begin if FSlanted and (FSlantAngle <> 0) then begin tanAlpha := tan(GetSlantAngle); - baseY := round(FScaleFactor * 30 * (FSize - 1)); + baseY := round(FScaleFactor * BASE_HEIGHT * (FSize - 1)); for i := 0 to MAX_POINTS do SlantPoint(Points[i], baseY, tanAlpha); end; @@ -346,9 +362,9 @@ end; function TCustomLEDNumber.NewOffset(xOry: char; OldOffset: Integer): Integer; begin if (xOry = 'x')then - Result := oldOffset + round(FScaleFactor * 17 * (FSize - 1)) + Result := oldOffset + round(FScaleFactor * BASE_WIDTH * (FSize - 1)) else - Result := oldOffset + round(FScaleFactor * 30 * (FSize - 1)); + Result := oldOffset + round(FScaleFactor * BASE_HEIGHT * (FSize - 1)); end; {=====} @@ -415,8 +431,8 @@ var begin if (Segment and $FFFF) = $FFFF then begin MyColor := FOnColor; - PaintSegment(17, MyColor, Points, OffsetX, OffsetY); - PaintSegment(18, MyColor, Points, OffsetX, OffsetY); + PaintSegment(BASE_WIDTH, MyColor, Points, OffsetX, OffsetY); + PaintSegment(BASE_WIDTH+1, MyColor, Points, OffsetX, OffsetY); end else begin Bit := $8000; @@ -451,7 +467,6 @@ begin Last := #0; OffsetX := FSize; OffsetY := 0; - DisplayStr := Caption; if Length(DisplayStr) > 0 then @@ -479,12 +494,13 @@ begin OffsetX := NewOffset('x', OffsetX); end else begin - OffsetX := OffsetX - round(FScaleFactor * 17 * (FSize - 1)); + OffsetX := OffsetX - round(FScaleFactor * BASE_WIDTH * (FSize - 1)); Tmp := (Characters[CharacterNDX[Ord(Next)]] or Characters[CharacterNDX[Ord(Last)]]); SelectSegments(Tmp, Points, OffsetX, OffsetY); OffsetX := NewOffset('x', OffsetX); end else begin + if FZeroToO and (Next = '0') then Next := 'O'; Tmp := Characters[CharacterNDX[Ord(Next)]]; SelectSegments(Tmp, Points, OffsetX, OffsetY); OffsetX := NewOffset('x', OffsetX); @@ -546,8 +562,8 @@ begin FRows := Row; FColumns := Col; FSize := ASize; - h := round(FScaleFactor * FRows * 30 * (FSize - 1)); - w := round(FScaleFactor * (FColumns * 17 * (FSize - 1))); + h := round(FScaleFactor * FRows * BASE_HEIGHT * (FSize - 1)); + w := round(FScaleFactor * (FColumns * BASE_WIDTH * (FSize - 1))); if FSlanted and (FSlantAngle <> 0) then inc(w, round(h * tan(GetSlantAngle))); SetBounds(Left, Top, w, h); @@ -555,10 +571,10 @@ begin end; {=====} -procedure TCustomLEDNumber.SetbgColor(Value: TColor); +procedure TCustomLEDNumber.SetBGColor(Value: TColor); begin - if FBgColor <> Value then begin - FBgColor := Value; + if FBGColor <> Value then begin + FBGColor := Value; Invalidate; end; end; @@ -580,7 +596,12 @@ begin Invalidate; end; end; -{=====} + +procedure TCustomLEDNumber.SetParent(NewParent: TWinControl); +begin + inherited; + Resizecontrol(FRows, FColumns, FSize); +end; procedure TCustomLEDNumber.SetRows(Value : Integer); begin diff --git a/components/industrialstuff/source/switches.pas b/components/industrialstuff/source/switches.pas index 9e928477f..ac01f4f86 100644 --- a/components/industrialstuff/source/switches.pas +++ b/components/industrialstuff/source/switches.pas @@ -265,14 +265,9 @@ begin inherited DoAutoAdjustLayout(AMode, AXProportion, AYProportion); if AMode in [lapAutoAdjustWithoutHorizontalScrolling, lapAutoAdjustForDPI] then begin - DisableAutosizing; - try - case Orientation of - soHorizontal : FButtonSize := Round(FButtonSize * AXProportion); - soVertical : FButtonSize := Round(FButtonSize * AYProportion); - end; - finally - EnableAutoSizing; + case Orientation of + soHorizontal : FButtonSize := Round(FButtonSize * AXProportion); + soVertical : FButtonSize := Round(FButtonSize * AYProportion); end; end; end;