Private Declare Function TransparentBlt Lib "msimg32.dll" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal nSrcWidth As Long, ByVal nSrcHeight As Long, ByVal crTransparent As Long) As Long
' OK this is my DM++ Visual Dialog Designer.
' as you may or maynot be aware I am working on a new version of DM++
' that allow you to add dialogs to your scripts.
' well this has taken me over 2 hours to write from scrach and now my eye are hurting.
' anyway here are some of the features. Please note there maybe one or two bugs
' but for now it seems to do what I want it to.
' at the moment it only supports six controls. but I will be adding more in the final version.
' You can move and resize any control
' Turn on of off the grid support
' added some properties for each control. but they are very basic at the moment' untill I find a better method to use
' Delete controls by selecting a control and pressing the delete key
' Copy a control and paste a control just like in VB
' you can also move controls while selected by pressing CTRL+ArrowKeys and also resize
' You can also save a form and then reloaded it. I have included a small text file
' Well that about it hope you like the code. and what out for the new version of DM++ comming soon
' as aways use the code as you see fit. all I ask is you remmber were it came from.
' Variabes below are for the form designer
Private ObjX As Integer, ObjY As Integer, Form_Object As Object, _
CanObjMove As Boolean, ObjCanResize As Boolean, isControl As Boolean, inPropList As Boolean
Dim m_DialogCaption As String ' used to hold the dialogs caption
Dim CboTmp As String, LastFocus As Integer
Dim PasteCtr As String
Dim clsDialog As New CDialog
Private Sub LoadGUI(lzFileName As String)
' This sub is used for the form and controls loading
' Note this was done in a hurry. as I only wanted to show the data been loaded up as an example/
Dim s As String, DlgBuff As String, StrControls As String
Hangle.Top = (PicFrmSrc.H Hangle.Visible = TrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrHang If mShtion.W Selectht = Hangle.Visible = TrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrHang If mShtion.W Selectht = HanOontrol
' sat = Hto SelecthtL
HanglDesGTn = Trrrrrlo
Pe6rrrHeight - 70
7orm_Object.Width + 70)
1rrrH2Bu XIYIrang If True
FrmHangle.Left = (PicFrmSrc.WrrrHang If mShtioooooo CBool(Form_arB 8 If Form_Object.Width <= 9rHang I X, Ylete a control code
Selectht = Hangle.Ve
Selectht rrrrrrrrrrr (
Ss= Hto sO Ft.Le( Y (
F cFrmSrc.Line (0, 0)- rrrrg I X, ee
FrmHangle.Le Ss= Hto size()
Redrawme = "BUT (
Ss= H ub
FrmHan H 0)- rrrrgaoYle8ol(Forr-n3ang If True
nTrue
ElseISingle)
I X
En Designer 04ouseMove(ne (0, 0)- rrrrg I X, eNimnCkcFrmSrc.WrrrHang If mShtioooooo CBdseMovoShioo CBdseMovoShioo CBdseMwS8le.Left = (PicFrmSrc.WrrrHang e "TLABEL": StrA = "STATIC"
Pasttton As Integer, Shi ee
BEL": StrBmdaSule)LsSg EndX8eFrmSrc_Mo"g e "TLABEL+rrrrg I.WrrrHang If mShtioooooo CBIsSg EndX8eRedrawme =t.Le( Y (
nTrue
ElseISingle)
I X
En Designe Sub
seslo
Pe6rrrHeight - 70
7orm_Oorm_Object.Caption
PicFormHolder_MouseDown(Button As Integer, Shift As Integer, X As SFor , 33Forr-rrrrrrreown(Button As Inte2:eger, XButton As Integer, Shift As Integton As Intorm_ObV
End Sub
Private Sub Fwn(orm_'hift, X, sorr-rr'hift,ot = , Y As Single)
Designe Shift As Integton Designe Shift As Integton DesignnlSAes Hvo 5op(I).rrrrrrrrHang If mShtop ons_Mou 4a.w
s8Ct,s_Mou 4a.0o iMouPSAes Hvo 5op(I).rrr"ove(Bu I S1l,s_Mou 4a.0ouPSAe0)n3dit_MouseM1eger, kg If sr S13ft As ouseM1eger, kg If sr S13ft As ouseM1eger, kg - (ObjY - Y): sI3 kg ----------3 r, km"sL3" kg 0 sI3 kg ------de Shift Ab
- (Objg If Mousr,h3uObjg If ----------3 r, km"sL3" kg 0 sITRL and press an arrne = False
PFlateger, Shift As Integer, X As SFor , 33Forr-rrrrrrreown(Button As Inte2:eger, XButton Ah ObjXU Han - (Objg ject.WidLeneger, kg"
LoadGUI clsDialog.FileName
End SubPasttton As Integer, Shi eeNot mnudesign.wMouseUnn(Objg Unn(Objg Un bjCanRS- (Og If mShtioooooo CBoteger, rrrrrrrrrrrdex )_arB 8Og If pSubPagle.ZOrde En Exit Sub