Jump to content
Sign in to follow this  
rmmachado

Create Python GUI with Delphivlc

Recommended Posts

Hello,
I need to create a GUI for a Python application and I am using the PyScripter editor.
I have found the delphivcl library that uses Windows objects and components. However I want to use the library without using Delphi RAD Studio IDE.
I am not able to find the delphivcl documentation about the objects, methods...
Can anyone help me?

Edited by rmmachado

Share this post


Link to post

DelphiVCL implements a good subset of VCL objects and related methods/properties/events.
You can find full Embarcadero VCL documentation on the net: https://docwiki.embarcadero.com/
 

To know what objects methods/properties/events are implemented and available in DelphiVCL python unit 
there are two ways (that I know):

1] Look at sources of P4D in github.
2] Inspect imported module and every class you want to use:

Example to inspect VCL objects and Form object:

P:\>python
Python 3.9.12 (tags/v3.9.12:b28265d, Mar 23 2022, 23:52:46) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

>>> import delphivcl as vcl
>>> dir(vcl)
['Abort', 'Action', 'ActionList', 'ActivityIndicator', 'Application', 'BaseBindScopeComponent', 'BaseLinkingBindSource', 
'BaseObjectBindSource', 'BasicAction', 'BasicBindComponent', 'Bevel', 'BindComponentDelegate', 'BindingsList', 'BitBtn', 
'Bitmap', 'BoundLabel', 'Button', 'Canvas', 'CheckBox', 'Collection', 'ColorBox', 'ComboBox', 'Component', 'ContainedAction', 
'ContainedActionList', 'ContainedBindComponent', 'Control', 'ControlBar', 'CreateComponent', 'CustomAction', 'CustomActionList', 
'CustomActivityIndicator', 'CustomBindingsList', 'CustomControl', 'CustomDrawGrid', 'CustomEdit', 'CustomForm', 'CustomGrid', 
'CustomLinkControlToField', 'CustomLinkListControlToField', 'CustomLinkPropertyToField', 'CustomMemo', 'CustomNumberBox', 
'CustomPrototypeBindSource', 'CustomStyleServices', 'CustomTabControl', 'CustomToggleSwitch', 'DateTimePicker', 'DelphiDefaultContainer', 
'DelphiDefaultIterator', 'DelphiMethod', 'DrawGrid', 'Edit', 'FileOpenDialog', 'Form', 'FreeConsole', 'Graphic', 'GroupBox', 
'Header', 'IDABORT', 'IDCANCEL', 'IDCLOSE', 'IDCONTINUE', 'IDHELP', 'IDIGNORE', 'IDNO', 'IDOK', 'IDRETRY', 'IDTRYAGAIN', 'IDYES', 
'Icon', 'Image', 'Label', 'LabeledEdit', 'LinkControlDelegate', 'LinkControlToField', 'LinkControlToFieldDelegate', 
'LinkListControlToField', 'LinkPropertyToField', 'LinkPropertyToFieldDelegate', 'ListBox', 'MB_ABORTRETRYIGNORE', 'MB_APPLMODAL', 
'MB_DEFBUTTON1', 'MB_DEFBUTTON2', 'MB_DEFBUTTON3', 'MB_DEFBUTTON4', 'MB_HELP', 'MB_ICONASTERISK', 'MB_ICONERROR', 'MB_ICONEXCLAMATION', 
'MB_ICONHAND', 'MB_ICONINFORMATION', 'MB_ICONQUESTION', 'MB_ICONSTOP', 'MB_ICONWARNING', 'MB_NOFOCUS', 'MB_OK', 'MB_OKCANCEL', 
'MB_RETRYCANCEL', 'MB_SYSTEMMODAL', 'MB_TASKMODAL', 'MB_YESNO', 'MB_YESNOCANCEL', 'MainMenu', 'MediaPlayer', 'Memo', 'Menu', 'MenuItem', 
'Metafile', 'Monitor', 'Notebook', 'NumberBox', 'Object', 'OpenDialog', 'Page', 'PageControl', 'PaintBox', 'Panel', 'PascalInterface', 
'PascalRecord', 'Persistent', 'Picture', 'Point', 'PopupMenu', 'PrototypeBindSource', 'RadioButton', 'RadioGroup', 'Rect', 'Screen', 
'ScrollBar', 'Shape', 'ShowMessage', 'Size', 'SpeedButton', 'SpinButton', 'SpinEdit', 'Splitter', 'StaticText', 'StringGrid', 'Strings', 
'StyleInfo', 'StyleManager', 'StyleServices', 'TabControl', 'TabSheet', 'Timer', 'ToggleSwitch', 'ToolBar', 'ToolButton', 'TrackBar', 
'VarParameter', 'WinControl', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', 'bkAbort', 'bkAll', 'bkCancel', 
'bkClose', 'bkCustom', 'bkHelp', 'bkIgnore', 'bkNo', 'bkOK', 'bkRetry', 'bkYes', 'caFree', 'caHide', 'caMinimize', 'caNone', 'cl3DDkShadow',
 'cl3DLight', 'clActiveBorder', 'clActiveCaption', 'clAppWorkSpace', 'clAqua', 'clBackground', 'clBlack', 'clBlue', 'clBtnFace', 
 'clBtnHighlight', 'clBtnShadow', 'clBtnText', 'clCaptionText', 'clCream', 'clDefault', 'clDkGray', 'clFuchsia', 'clGradientActiveCaption', 
 'clGradientInactiveCaption', 'clGray', 'clGrayText', 'clGreen', 'clHighlight', 'clHighlightText', 'clHotLight', 'clInactiveBorder', 
 'clInactiveCaption', 'clInactiveCaptionText', 'clInfoBk', 'clInfoText', 'clLime', 'clLtGray', 'clMaroon', 'clMedGray', 'clMenu', 'clMenuBar', 
 'clMenuHighlight', 'clMenuText', 'clMoneyGreen', 'clNavy', 'clNone', 'clOlive', 'clPurple', 'clRed', 'clScrollBar', 'clSilver', 'clSkyBlue',
 'clTeal', 'clWhite', 'clWindow', 'clWindowFrame', 'clWindowText', 'clYellow', 'fsBorder', 'fsSurface', 'gdFixed', 'gdFocused', 'gdSelected',
 'mdNearest', 'mdNull', 'mdPrimary', 'mrAbort', 'mrAll', 'mrCancel', 'mrIgnore', 'mrNo', 'mrNoToAll', 'mrNone', 'mrOk', 'mrRetry', 'mrYes', 
 'mrYesToAll', 'ssAlt', 'ssCtrl', 'ssDouble', 'ssLeft', 'ssMiddle', 'ssRight', 'ssShift']

>>> form = vcl.Form(None)
>>> dir(form)
['Action', 'Active', 'ActiveControl', 'ActiveMDIChild', 'ActiveOleControl', 'AfterConstruction', 'Align', 'AlignDisabled', 'AlignWithMargins',
 'AlphaBlend', 'AlphaBlendValue', 'Anchors', 'ArrangeIcons', 'Assign', 'AutoScroll', 'AutoSize', 'BeforeDestruction', 'BeginDrag', 'BeginInvoke',
 'BiDiMode', 'BindMethodsToEvents', 'BorderIcons', 'BorderStyle', 'BorderWidth', 'BoundsRect', 'BringToFront', 'Broadcast', 'Brush', 'CPP_ABI_1',
 'CPP_ABI_2', 'CPP_ABI_3', 'CanFocus', 'Canvas', 'Caption', 'Cascade', 'CheckNonMainThreadUsage', 'ClassInfo', 'ClassName', 'ClassNameIs', 
 'ClassParent', 'ClassType', 'CleanupInstance', 'ClientHandle', 'ClientHeight', 'ClientOrigin', 'ClientRect', 'ClientToParent', 'ClientToScreen',
 'ClientWidth', 'Close', 'CloseQuery', 'Color', 'ComObject', 'ComponentCount', 'ComponentIndex', 'ComponentState', 'ComponentStyle', 'Components',
 'Constraints', 'ContainsControl', 'ControlAtPos', 'ControlCount', 'ControlState', 'ControlStyle', 'Controls', 'Create', 'CreateNew', 'CreateParented',
 'CreateParentedControl', 'Ctl3D', 'CurrentPPI', 'Cursor', 'CustomHint', 'CustomTitleBar', 'DefaultHandler', 'DefaultMonitor', 'DefocusControl',
 'DesignInfo', 'Designer', 'Destroy', 'DestroyComponents', 'Destroying', 'DisableAlign', 'DisableAutoRange', 'Dispatch', 'DisposeOf', 'Dock',
 'DockClientCount', 'DockDrop', 'DockManager', 'DockOrientation', 'DockSite', 'DoubleBuffered', 'DragDrop', 'DragKind', 'DragMode', 'Dragging',
 'DrawTextBiDiModeFlags', 'DrawTextBiDiModeFlagsReadingOnly', 'DropTarget', 'EnableAlign', 'EnableAutoRange', 'Enabled', 'EndDrag', 
 'EndFunctionInvoke', 'EndInvoke', 'Equals', 'ExecuteAction', 'ExplicitHeight', 'ExplicitLeft', 'ExplicitTop', 'ExplicitWidth', 'FieldAddress',
 'FindChildControl', 'FindComponent', 'FlipChildren', 'Floating', 'FloatingDockSiteClass', 'FocusControl', 'Focused', 'Font', 'FormState',
 'FormStyle', 'Free', 'FreeInstance', 'FreeNotification', 'FreeOnRelease', 'GetChildren', 'GetControlsAlignment', 'GetEnumerator', 'GetFormImage', 
 'GetHashCode', 'GetInterface', 'GetInterfaceEntry', 'GetInterfaceTable', 'GetNamePath', 'GetParentComponent', 'GetStyleName', 'GetSystemMetrics', 
 'GetTabControlList', 'GetTabOrderList', 'GetTextBuf', 'GetTextLen', 'GlassFrame', 'Handle', 'HandleAllocated', 'HandleNeeded', 'HasParent', 'Height',
 'HelpContext', 'HelpFile', 'HelpKeyword', 'HelpType', 'Hide', 'Hint', 'HorzScrollBar', 'HostDockSite', 'Icon', 'InheritsFrom', 'InitInstance', 
 'InitiateAction', 'InsertComponent', 'InsertControl', 'InstanceSize', 'Invalidate', 'IsCustomStyleActive', 'IsDrawingLocked', 'IsImplementorOf',
 'IsLightStyleColor', 'IsRightToLeft', 'IsShortCut', 'KeyPreview', 'LRDockWidth', 'Left', 'LoadProps', 'LockDrawing', 'MDIChildCount',
 'MakeFullyVisible', 'ManualDock', 'ManualFloat', 'Margins', 'Menu', 'MethodAddress', 'MethodName', 'ModalResult', 'Monitor', 'MouseInClient', 
 'MouseWheelHandler', 'Name', 'NewInstance', 'Next', 'ObjectMenuItem', 'Observers', 'OleFormObject', 'OnActivate', 'OnAfterMonitorDpiChanged', 
 'OnAlignInsertBefore', 'OnAlignPosition', 'OnBeforeMonitorDpiChanged', 'OnCanResize', 'OnClick', 'OnClose', 'OnCloseQuery', 'OnConstrainedResize',
 'OnContextPopup', 'OnCreate', 'OnDblClick', 'OnDeactivate', 'OnDestroy', 'OnDockDrop', 'OnDockOver', 'OnDragDrop', 'OnDragOver', 'OnEndDock',
 'OnGesture', 'OnGetSiteInfo', 'OnHelp', 'OnHide', 'OnKeyDown', 'OnKeyPress', 'OnKeyUp', 'OnMouseActivate', 'OnMouseDown', 'OnMouseEnter',
 'OnMouseLeave', 'OnMouseMove', 'OnMouseUp', 'OnMouseWheel', 'OnMouseWheelDown', 'OnMouseWheelUp', 'OnPaint', 'OnResize', 'OnShortCut', 'OnShow', 
 'OnStartDock', 'OnUnDock', 'Owner', 'Padding', 'PaintTo', 'Parent', 'ParentBiDiMode', 'ParentCustomHint', 'ParentDoubleBuffered', 'ParentFont',
 'ParentToClient', 'ParentWindow', 'Perform', 'PixelsPerInch', 'PopupMenu', 'PopupMode', 'PopupParent', 'Position', 'PreProcessMessage', 'Previous',
 'Print', 'PrintScale', 'QualifiedClassName', 'Realign', 'RecreateAsPopup', 'RedrawDisabled', 'ReferenceInterface', 'Refresh', 'Release', 
 'RemoveComponent', 'RemoveControl', 'RemoveFreeNotification', 'Repaint', 'ReplaceDockedControl', 'SafeCallException', 'ScaleBy', 'ScaleFactor',
 'ScaleForCurrentDPI', 'ScaleForPPI', 'ScaleRectSize', 'ScaleValue', 'Scaled', 'ScreenSnap', 'ScreenToClient', 'ScrollBy', 'ScrollInView',
 'SendCancelMode', 'SendToBack', 'SetBounds', 'SetDesignVisible', 'SetFocus', 'SetFocusedControl', 'SetParentComponent', 'SetProps', 'SetSubComponent',
 'SetTextBuf', 'Show', 'ShowHint', 'ShowModal', 'Showing', 'SnapBuffer', 'StyleElements', 'StyleName', 'TBDockHeight', 'TabOrder', 'TabStop', 'Tag',
 'TaskbarHandler', 'Tile', 'TileMode', 'TipMode', 'ToList', 'ToString', 'ToTuple', 'Top', 'Touch', 'TransparentColor', 'TransparentColorValue',
 'UndockHeight', 'UndockWidth', 'UnitName', 'UnitScope', 'UnlockDrawing', 'Update', 'UpdateAction', 'UpdateControlState', 'UpdateDesignerCaption',
 'UseDockManager', 'UseRightToLeftAlignment', 'UseRightToLeftReading', 'UseRightToLeftScrollBar', 'VCLComObject', 'VertScrollBar', 'Visible',
 'VisibleDockClientCount', 'WantChildKey', 'Width', 'WindowMenu', 'WindowProc', 'WindowState', '__bound__', '__dir__', '__owned__', 'set_PopupParent']
>>>

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×