Source

delPython / demo / main.dfm

Full commit
object Form1: TForm1
  Left = 0
  Top = 0
  Caption = 'Form1'
  ClientHeight = 423
  ClientWidth = 791
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'Tahoma'
  Font.Style = []
  OldCreateOrder = False
  OnCreate = FormCreate
  OnDestroy = FormDestroy
  PixelsPerInch = 96
  TextHeight = 13
  object Memo1: TMemo
    AlignWithMargins = True
    Left = 3
    Top = 50
    Width = 785
    Height = 370
    Align = alClient
    Lines.Strings = (
      'form1.Tag = 42'
      'assert(form1.Tag == 42, '#39'integer prop. fail!'#39')'
      'form1.Caption = "foo bar spam"'
      'assert(form1.Caption == "foo bar spam", '#39'string prop. fail!'#39')'
      ''
      'from ctypes import c_int, WINFUNCTYPE, windll'
      'from ctypes.wintypes import HWND, LPCSTR, UINT'
      ''
      'def on_click():'
      '    #messagebox ayarla'
      '    prototype = WINFUNCTYPE(c_int, HWND, LPCSTR, LPCSTR, UINT)'
      
        '    paramflags = (1, "hwnd", 0), (1, "text", "Hi"), (1, "caption' +
        '", None), (1, "flags", 0)'
      
        '    MessageBox = prototype(("MessageBoxA", windll.user32), param' +
        'flags)'
      '    MessageBox(text="Spam, spam, spam")'
      ''
      'def bind_event(delphi_event, python_handler):'
      '    # following is the binding point'
      
        '    #prototype = WINFUNCTYPE(c_void_p, c_uint) # for a TNotifyEv' +
        'ent; xxx c_int should be interpreted as a pointer to TObject'
      
        '    handler = prototype(xxx) # pointer to a method pointer from ' +
        'Delphi'
      '    #handler() # call the event handler')
    ScrollBars = ssBoth
    TabOrder = 0
  end
  object Panel1: TPanel
    AlignWithMargins = True
    Left = 3
    Top = 3
    Width = 785
    Height = 41
    Align = alTop
    TabOrder = 1
    OnClick = Panel1Click
    object btnExecute: TButton
      Left = 7
      Top = 9
      Width = 162
      Height = 25
      Caption = 'Execute code below!'
      TabOrder = 0
      OnClick = btnExecuteClick
    end
    object Button3: TButton
      Left = 192
      Top = 9
      Width = 129
      Height = 25
      Caption = 'Start Unittests'
      TabOrder = 1
      OnClick = Button3Click
    end
  end
end