Print Page | Close Window

Form Designer -- advice wanted

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: MarkupLabel Control
Forum Description: Topics Related to Codejock MarkupLabel Control
URL: http://forum.codejock.com/forum_posts.asp?TID=16961
Printed Date: 04 May 2024 at 1:51pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Form Designer -- advice wanted
Posted By: chrisABC
Subject: Form Designer -- advice wanted
Date Posted: 16 July 2010 at 5:15am
I want to allow end users of my software (ie at Run Time) to design their own input Form or report layout.
This means I need to display a Form, and let the user add Labels, Textboxes, Images, Lines, etc, and be able to drag these around, resize, set colors and fonts, etc.
Finally I need to save properties of all the controls, and load them again when required.

I've got rough examples working, just using standard VB, saving each property in a field in a database.

Can you suggest any CJ Controls that would make this sort of thing easier?  I am thinking maybe (and vaguely) of Markup Label, and saving/loading XML.
Are there any samples of this type of thing?  Is there a better Topic to ask this question?


-------------
Chris (Manchester, UK) -- www.abc6.co.uk ---- Using CodeJock ActiveX Suite 13.1.0 with Windows8, VB6 SP6



Replies:
Posted By: JantjeKeizer
Date Posted: 16 July 2010 at 7:01pm
Not answering your question, but do you have a really good reason to do this?
Usually this is a very bad idea and hard to maintain.
If you want the end user to have customized forms, then make a plugin system and expose core functionality.


Posted By: Fabian
Date Posted: 17 July 2010 at 2:52am
Hi
 
Look here: http://www.greatis.com/vb/formdes/index.html - http://www.greatis.com/vb/formdes/index.html
 
Regards, Fabian


-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.3

Platform: Windows 7 (32bit)

Language: Visual Basic 6.0 / SP6


Posted By: chrisABC
Date Posted: 17 July 2010 at 7:00am
Yes I have a need for this. My accounting app allows users to design their own reports and label layouts, and create their own database for storing things like club membership details. For years I have done this using normal VB controls though it is a bit crude and not that pretty.

I just wondered if CodeJock had anything that could be used to improve things? Or even better, a sample showing how to do it?


-------------
Chris (Manchester, UK) -- www.abc6.co.uk ---- Using CodeJock ActiveX Suite 13.1.0 with Windows8, VB6 SP6


Posted By: chrisABC
Date Posted: 17 July 2010 at 7:03am
Thanks, I have seen the greatis control and it looks to be exactly what I am wanting to do.  But it is another 3rd party control that I would have to buy and distribute to end-users.

But mainly, I want to do it myself (hopefully with CJ controls) so I have full control ('scuse pun) over the program and can make it look the same as the rest of my app.


-------------
Chris (Manchester, UK) -- www.abc6.co.uk ---- Using CodeJock ActiveX Suite 13.1.0 with Windows8, VB6 SP6


Posted By: Aaron
Date Posted: 17 July 2010 at 8:14am
Hi Chris,
 
It could be done with Markup but I think this means a lot of coding... Newly added MarkupWindowContainer object could be used to add textboxes, buttons etc etc. So visual aspects like size, position, colors, fonts etc... shouldn't be that hard to implement. Storing and loading the entire layout ??? I don't know ?!?!  Maybe it's a simple thing to do... (Better ask Jason
 
For the properties of (for example) a textbox, do you load members from TypeLib or do you have only a few properties that you can manipulate? CJ PropertyGrid control could be used for the settings part (just like VB IDE uses a propertygrid for all ActiveX controls) and it's easy to use  
 
Well there are a lot of options but not one with "built in" functionality you want, Good luck
 
 
 
     


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....


Posted By: jpbro
Date Posted: 17 July 2010 at 9:09am
I think it would be a pretty big job, but I think that it could be done with the MarkupLabel control, especially the latest (non-public) version with the new MarkupWindowContainer object. Maybe you could a support ticket and ask Oleg for the new version so you could test it out?

If you only had a few control "types" that you want to make available to the user, you could have a Collection object hold classes representing your controls virtually (position, size, control type, value, etc...). Then when the user clicks an area where a control is supposed to be, you could move the WindowContainer to that position and make it visible. When the user clicks somewhere that there is no control, you could hide the WindowContainer. This way, you need only have 1 control of each type that the user can have, and you just show and hide it dynamically.  Whether or not this would be satisfactory would depend on your requirements.

The biggest issue will be moving the objects around by mouse, since I have not solved this problem very well yet - there is still apparently no way to get the current position of a Markup object, so it makes relative movement difficult. It's possible that using the MarkupWindowContainer object with an ActiveX control that the ActiveX control Left, Top, etc... properties will return their position, but I haven't had a chance to test this yet.

You also might find it easier to put everything inside a MarkupGrid object in order to constrain the user to certain cells - but again, this may not be satisfactory, depending on your requirements.

Anyway, if you care to give it a try, I would be glad to help as much as I can (which unfortunately isn't as much as it used to be lately!), so just post back with any problems that you encounter and we'll see if we can solve them,




-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6



Posted By: chrisABC
Date Posted: 17 July 2010 at 10:18am
Thanks for the very useful reply.

> If you only had a few control "types" that you want to make available to the user,
> you could have a Collection object hold classes representing your controls
> virtually (position, size, control type, value, etc...).
That is roughly what I do at present -- I have one textbox, one label, and one imagebox, and that is all the users can change.  They can "add" copies of these controls in the control collection.

For years I used Windows API functions to permit dragging and resizing the objects.  Now (after seeing some example code on the internet) I have got rid of all that and made things MUCH simpler.
Basically, in the MouseDown event of each control I note the mouse X and Y location.
then in the MouseMove event I see how much the mouse has moved and adjust the position of the control (as long as mouse is still down).

For resizing, I just put a small dot at the corners of the control (when MouseDown on control to select it), and then in the MouseMove event of the dot, adjust the size of the control.

By setting the MouseCursor type as appropriate, it all works smoothly and neatly --exactly like editing controls in the VB IDE. I am amazed how well it works.

I will take a look at the CJ Property editor as that does sound just what I want.


-------------
Chris (Manchester, UK) -- www.abc6.co.uk ---- Using CodeJock ActiveX Suite 13.1.0 with Windows8, VB6 SP6



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net