Skip to content

devlephant/sizectrl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

86 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description

TSizeCtrl is a non-visual V+LCL component, which allows you to resize, select and move TControl decadents

Unlike original realization, current version supports both Delphi and Lazarus, so it's inspired by original version by Angus Johnson, but, now it's not the same as legacy/old version :)

Features:
  • Fully customizable buttons: you can change count (from 4 to 8), colour, size, transparency, shape, and if you want to - you can set the button image
  • 5 shape types: Square, Circle, Rhombus, Triangle and RoundRect
  • Customizable selection frame: movePanelCanvas property to access all of the selection frames canvases at once, with transparency (Brush.Style := bsClear) support
  • ShowFrame property to show/hide selection frame
  • MovePanelAlphaBlend property to specify alpha-channel of the sizing/selection frame
  • MovePanelImage property to set the Selection Frame image
  • TCustomForms support: when form is resized with TSizeCtrl, it cannot be closed or maximized/minimized
  • Grid support, with properties: gridSize, showGrid, gridColor, gridColorContrast
  • Resizing options:
    • AlignToGrid property - align controls to the grid
    • ApplySizes property - activate to change object's size immediately
    • MultiTargetResize property - to deny/allow resizing of few targets at once
    • Constraints property to specify minimal and maximal sizes of the resizable object
    • MoveOnly property to deny/allow resizing of an objects
    • Objects tag support, to deny object from selecting
    • Customizable buttons: colours ({content-fill, border}) and images for Enabled, Hovered and Disabled states
    • ApplySizes property - to apply sizes to the object immediately
    • EditDisabled property to allow (Enabled := False)->Disabled components editing
    • Different resize-during button styles: none (buttons are hidden), buttons (all buttons are visible), line, single button
    • Different resize-during button hide options: none (buttons are visible, but static), hide (buttons are hidden), move (buttons will be moved in case of moving, but hidden in case of sizing)
  • Additional options:
    • Stretch properties supplied with every Image(TPicture) properties, to specify which images you would like to store in the original size
    • Customizable modification keys (selection, moving/sizing, align-ignoring keys)
    • OnHover events for TSizeBtns (sizing grips/handles)
Limitations
    Lazarus:
    • Currently not ssupporting MovePanelImage property
    • In some platforms it cannot support Alpha-Transparency
    FireMonkey:
    • Not tested yet
Errors and bugs:
  • Fixed common bugs:
    • Bug with Sizing Grid (ShowGrid) on non-TForm controls
    • Selection bug with Form focus (when you trying to change the form, and TSizeCtrl still handles events)
    • Selection bug with Forms (when you size form, its Caption Bar with action buttons is still available, which is kinda irritating)
    • Moving bugs with DoubleBuffering Enabled
    • Bug with btn size, when object Left+Top = Btn Diameter(Size)
    • Bug with recursion in DefWindowProc -- FormWindowProc
    • Bug with unassigned control, which caused by size-during component selection
    • Bug with cursor: sometimes it's won't change, when the moving is started (with TShape, for example)
    • Moving object with keys, while editing it by mouse, causes sizing bugs
    • Bug with invisible objects: it denies visible, but upper object selection
  • Known modern bugs:
    • 1. Add disabled objects selection support [Lazarus]
      Possible solution: hook all WndProces recursive?
Nearly plans:
  • New Features:
    • 1. Align with lines (function, ef)
    • 2. Detect control polygon to draw shape to fit the form
    • 3. Custom tag(s) support
    • 4. D/L CL real transparency fast support with DrawFocusRect method and Focus rect type, which can specify how to draw the focus rect
    • 5. Property to hide focus rect only when resizing
  • Refactorings:
    • 1. Flipping control, when its sizes is too small (Changing position + resizing)
    • 2. Regenerate Frame topmost settings(Add FrameOnTop property, e.g make the TMovePanel parent the same as TSizeBtn parent, if needed) [Delphi,LAzarus]
    • 3. Limit resizing when control is inserted in aligned or when control contains both aligned and unaligned sub-ctrls (childs)