Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

saving

Status
Not open for further replies.

gzosh

Programmer
Jun 18, 2001
5
0
0
US
I've created a flowsheet that has a toolbar with icons in it. The icons can be dragged and dropped onto the flowsheet. I'd like to know how I can get my program to save the flowsheet with the icons in the position that I left them in.
 
Well, i'd give each icon an id number, and then save the id-number, left, and top positions.

When I load it, i'll get the icons corresponding to the idnumber, and place it at the saved top and left position.

i.e.

If we have 5 icons in the toolbar:

ICO : Smile.ico Frown.ico Laugh.ico Cross.ico Cry.ico
ID# : 1 2 3 4 5

If i drag Frown.ico to position (top, left) 123, 145
and Cry.ico to 452, 724

then i'll save:

[ico 1]
id=2
top=123
left=145

[ico 2]
id=5
top=452
left=724


the above save is based on .INI files. You can do it anyway you like _________________
Bixarrio

e = m * (c ^ 2)
 
Well, the icons on the flowsheet could be represented by objects with persistent properties, and save and load them through a PropertyBag...
 
I'd like to know how I can do the same functions that the following code does without having to use the registry.


Public Sub SaveProject()
Dim newProcess As CConnectors
Dim filename As String
Dim counter As Integer

filename = frmSaveAs.m_Save.filename
counter = 1
For Each newProcess In m_colObjects
SaveSetting filename, "Objects" & counter, "Left", newProcess.Left
SaveSetting filename, "Objects" & counter, "Top", newProcess.Top
SaveSetting filename, "Objects" & counter, "Inputs", newProcess.Inputs
SaveSetting filename, "Objects" & counter, "Outputs", newProcess.Outputs
SaveSetting filename, "Objects" & counter, "Process", newProcess.Process
SaveSetting filename, "Objects" & counter, "ProcessName", newProcess.ProcessName
SaveSetting filename, "Objects" & counter, "Picture", frmDragDrop.ImgProcess(counter).Picture
counter = counter + 1
Next
SaveSetting filename, "Objects", "Number", counter - 1
SaveSetting filename, "Lines", "Number", frmDragDrop.LineIndex - 1
For counter = 1 To frmDragDrop.LineIndex - 1
SaveSetting filename, "Lines" & counter, "X1", frmDragDrop.LineConnect(counter).X1
SaveSetting filename, "Lines" & counter, "X2", frmDragDrop.LineConnect(counter).X2
SaveSetting filename, "Lines" & counter, "Y1", frmDragDrop.LineConnect(counter).Y1
SaveSetting filename, "Lines" & counter, "Y2", frmDragDrop.LineConnect(counter).Y2
Next
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top