Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > MarkupLabel Control
  New Posts New Posts RSS Feed - Form Designer -- advice wanted
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Form Designer -- advice wanted

 Post Reply Post Reply
Author
Message
chrisABC View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 June 2008
Status: Offline
Points: 258
Post Options Post Options   Thanks (0) Thanks(0)   Quote chrisABC Quote  Post ReplyReply Direct Link To This Post Topic: Form Designer -- advice wanted
    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
Back to Top
JantjeKeizer View Drop Down
Groupie
Groupie


Joined: 12 February 2008
Status: Offline
Points: 70
Post Options Post Options   Thanks (0) Thanks(0)   Quote JantjeKeizer Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
Fabian View Drop Down
Senior Member
Senior Member
Avatar

Joined: 22 November 2004
Location: Switzerland
Status: Offline
Points: 336
Post Options Post Options   Thanks (0) Thanks(0)   Quote Fabian Quote  Post ReplyReply Direct Link To This Post Posted: 17 July 2010 at 2:52am
Hi
 
 
Regards, Fabian
Product: Xtreme SuitePro (ActiveX) version 16.2.3

Platform: Windows 7 (32bit)

Language: Visual Basic 6.0 / SP6
Back to Top
chrisABC View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 June 2008
Status: Offline
Points: 258
Post Options Post Options   Thanks (0) Thanks(0)   Quote chrisABC Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
chrisABC View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 June 2008
Status: Offline
Points: 258
Post Options Post Options   Thanks (0) Thanks(0)   Quote chrisABC Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post 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....
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1354
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
chrisABC View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 June 2008
Status: Offline
Points: 258
Post Options Post Options   Thanks (0) Thanks(0)   Quote chrisABC Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.156 seconds.