Welcome Guest.   Make a donation to an author on the site April 19, 2014, 05:17:13 PM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
The N.A.N.Y. Challenge 2013! Download dozens of custom programs!
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: Can Buttons be Dynamically Moved, Resized, etc. in Your Language?  (Read 4316 times)
CodeTRUCKER
Supporting Member
**
Posts: 1,024



Bush Flying... where I'd rather be.

see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« on: December 11, 2009, 02:00:49 PM »

Hello,

Due to health reasons, I have not worked since March 2009, so I am expanding my development scope.  I want to try an experiment that I have in my mind and if it works might be marketable to municipalities.  Call it a "Living Map."  I can already see other different applications for this if I can get it to work.  I am not tied to any particular code.  If I need to I can use (learn) Python, .NET, Java, etc.  My best and most successful programming was/is in Visual Basic, so I could leverage that but it may not be the best for this application.

As you read these present requirements, please observe if you would anticipate any cautions against certain traps or hurdles a particular language (yours?) would present.  It will use a main form with a sidebar.  Here are some particulars...

  • It will have a main form with a sidebar/corner-block.
  • There will be a stationary button on the sidebar/corner-block that the I can drag to the main form, drop and resize to my whim.  This would be just like dragging a control (button) to the form at design time.
  • This will be done as many times as I want to do so, anywhere from 2-100+ times.
  • If I drop it on the form on top of another existing button(s), I need to have the existing buttons make room for the new one.  This would require the existing buttons to...
    • Detect the new button was dropped.
    • The existing buttons would have to be recalculated and placed around the newly dropped button.
    • Allow any button to be dragged/dropped to anywhere on the form.
      • I guess I would also want a toggle/checkbox/radio-buttons to select if I wanted to have the button I am dragging to dynamically resize or to have all other buttons shrink/grow to make room for the button I am dragging.
      • It would be necessary to have each button "remember" their size because once the dragged button passes the existing buttons each button could return to its last established dimension, but...
      • ... if the dragged button's placement encroaches on the existing buttons it will be necessary for the surrounding buttons to assume new dimensions.
  • I also want to display text in different areas of the button, i.e., to dynamically display the dimensions of the button in pixels(?).
  • As a last option, I would want all the buttons to scale to fill the entire form without changing their relative position or the "aspect ratio" of the "view."

Ok, does that sound doable in your language?  

I have tried to make the above as clear as I could, but I realize there will probably be some questions... just ask.  I am not asking for "how" to do it, yet.  The math and logic are already congealing in my head.  I just need to know if these things are doable better or worse in the [Fill-in-the-Blank] language?  Just because it may be doable, doesn't mean I will have the skills to do it, but if I don't try, I'll never know.  

Thanks in advance for any input.
Logged

I applaud those that refuse to commit "intellectual suicide."

Truth, unlike opinion, tradition, etc. will always be able to stand on its own.  Truth is not a static, but a living entity and will perpetually impart life; therefore, any "truth" that does not or can not impart life can not be Truth.

I am persuaded the only reason bad men have succeeded is not because good men have done nothing, but that good men did not do enough.

An Open Letter to My Friends


Notice: - Unless stated otherwise, I receive no compensation for anything I post here.
Stoic Joker
Honorary Member
**
Posts: 4,878



View Profile WWW Give some DonationCredits to this forum member
« Reply #1 on: December 11, 2009, 06:01:40 PM »

Hm... Well the description of the behavior wanted seems clear enough, but what escapes me is the logic behind why it needed/wanted. Honestly the first thing that strikes me is there has got to be a better way of designing the interface.

Note: I'm from the start with the guts and work out school of thought e.g. top down design kills me... Wink

Can you elaborate on why large numbers of randomly grouped buttons are needed? ...Video game code (snippets & etc.) might be a good place to start on the how of this one.

As far as language goes, I'm a broken record for C++, but if you don't want to spend tons of time reasoning out the UI code C# might be better.
Logged
SingingBoyo
Participant
*
Posts: 38

Java is awesome... C++ needs more libraries

see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #2 on: December 11, 2009, 06:17:33 PM »

My vote would be Java... override a few paintComponent (or paint if you use AWT instead of Swing) methods, read a few tutorials for the more complex drag n' drop stuff, and you're off.
Logged

So you came along and found Java(insert programming language here)? Randomly?  Well then, you're just like me! Java fiends rule.  (Though other languages do have their uses.)
CodeTRUCKER
Supporting Member
**
Posts: 1,024



Bush Flying... where I'd rather be.

see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #3 on: December 11, 2009, 08:43:46 PM »

Hm... Well the description of the behavior wanted seems clear enough, but what escapes me is the logic behind why it needed/wanted. Honestly the first thing that strikes me is there has got to be a better way of designing the interface.

Note: I'm from the start with the guts and work out school of thought e.g. top down design kills me... Wink

Can you elaborate on why large numbers of randomly grouped buttons are needed? ...Video game code (snippets & etc.) might be a good place to start on the how of this one.

As far as language goes, I'm a broken record for C++, but if you don't want to spend tons of time reasoning out the UI code C# might be better.

Sorry, I'm not the only one involved, you know... some of the NDA stuff.  Wink   As far as C++ is concerned, I have to become very productive very quick and I have tried C++ at least 5 times and could never "get it."  I'm glad (and admire) that you can!  Good to see you back in circulation.  Do you have your gloves on?
« Last Edit: January 01, 2011, 01:29:23 PM by CodeTRUCKER » Logged

I applaud those that refuse to commit "intellectual suicide."

Truth, unlike opinion, tradition, etc. will always be able to stand on its own.  Truth is not a static, but a living entity and will perpetually impart life; therefore, any "truth" that does not or can not impart life can not be Truth.

I am persuaded the only reason bad men have succeeded is not because good men have done nothing, but that good men did not do enough.

An Open Letter to My Friends


Notice: - Unless stated otherwise, I receive no compensation for anything I post here.
CodeTRUCKER
Supporting Member
**
Posts: 1,024



Bush Flying... where I'd rather be.

see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #4 on: December 11, 2009, 08:50:49 PM »

My vote would be Java... override a few paintComponent (or paint if you use AWT instead of Swing) methods, read a few tutorials for the more complex drag n' drop stuff, and you're off.

Thanks SB - I appreciate the input.  Depending on the other opinions, I might try Java, but isn't it is a whole lot like C++?  
Still, given the Netbeans IDE is priced right, I could give that a serious "maybe."
« Last Edit: January 01, 2011, 01:30:49 PM by CodeTRUCKER » Logged

I applaud those that refuse to commit "intellectual suicide."

Truth, unlike opinion, tradition, etc. will always be able to stand on its own.  Truth is not a static, but a living entity and will perpetually impart life; therefore, any "truth" that does not or can not impart life can not be Truth.

I am persuaded the only reason bad men have succeeded is not because good men have done nothing, but that good men did not do enough.

An Open Letter to My Friends


Notice: - Unless stated otherwise, I receive no compensation for anything I post here.
SingingBoyo
Participant
*
Posts: 38

Java is awesome... C++ needs more libraries

see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #5 on: December 12, 2009, 12:25:10 AM »

I might try Java, but it is a whole lot like C++.  

Did I read that right?  Java is very different from C++.  Simpler, better tutorial, (Sun Java tutorial) and a massive graphics API that make GUI development easy...  C++ is a nightmare to understand, but Java is easier, and better documented.  Not to mention OS independant  cheesy

I'd suggest writing a couple simple GUI programs to get the hang of it before launching a full-sized project, but they can just be simple apps that take an hour or so to write
Logged

So you came along and found Java(insert programming language here)? Randomly?  Well then, you're just like me! Java fiends rule.  (Though other languages do have their uses.)
CodeTRUCKER
Supporting Member
**
Posts: 1,024



Bush Flying... where I'd rather be.

see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #6 on: December 12, 2009, 12:35:27 AM »

I might try Java, but it is a whole lot like C++.  

Did I read that right?  Java is very different from C++.  Simpler, better tutorial, (Sun Java tutorial) and a massive graphics API that make GUI development easy...  C++ is a nightmare to understand, but Java is easier, and better documented.  Not to mention OS independant  cheesy

I'd suggest writing a couple simple GUI programs to get the hang of it before launching a full-sized project, but they can just be simple apps that take an hour or so to write

I apologize.  I was writing about my last real experience with Java ten years ago.  Not exactly a fair comparison, right?   Ok, I'll give it a fair chance and we'll see what comes up.  smiley
Logged

I applaud those that refuse to commit "intellectual suicide."

Truth, unlike opinion, tradition, etc. will always be able to stand on its own.  Truth is not a static, but a living entity and will perpetually impart life; therefore, any "truth" that does not or can not impart life can not be Truth.

I am persuaded the only reason bad men have succeeded is not because good men have done nothing, but that good men did not do enough.

An Open Letter to My Friends


Notice: - Unless stated otherwise, I receive no compensation for anything I post here.
Stoic Joker
Honorary Member
**
Posts: 4,878



View Profile WWW Give some DonationCredits to this forum member
« Reply #7 on: December 12, 2009, 09:22:58 AM »

If I had to make a choice between Java & VB, I'd go with VB. I've never really seen a Java application that I liked, they always seem to be flaky, persnickety, and unstable. Sure I've used to for quickie bits on a web page, but I'd never try doing anything serious with it.

Seems to me that the only real "advantage" to Java is the one size fits all cross platform usage. However if being cross platform isn't an objective, then there is always a better way. This is for the same reason that a swiss army knife is a poor substitute for a proper tool kit. Sure it's handy for the type of quick fixes you can do while wearing a suit ... But don't try rebuilding an engine with one.
Logged
SingingBoyo
Participant
*
Posts: 38

Java is awesome... C++ needs more libraries

see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #8 on: December 15, 2009, 12:46:24 AM »

Seems to me that the only real "advantage" to Java is the one size fits all cross platform usage. However if being cross platform isn't an objective, then there is always a better way. This is for the same reason that a swiss army knife is a poor substitute for a proper tool kit. Sure it's handy for the type of quick fixes you can do while wearing a suit ... But don't try rebuilding an engine with one.

And RMI (big one for going easy on the sockets, though not necessary for this project), and easy graphics, a massive library that does just about anything, and CONSOLIDATED documentation!!!  I'll repeat myself...  CONSOLIDATED documentation.  There are many languages with good documentation, but I haven't found one yet with a complete tutorial that covers just about everything, with the exception of Java's excellent Sun Java Tutorial.  That was one of the biggest problems for me with C++, along with the sheer number of compilers out there - C++ has no tutorial that covers all the libraries out there, mainly because the C++ standard libraries are small, and most others are developed as open-source or compiler-specific. 

I don't know about VB, but I would hazard a guess that, being a microsoftism (nothing against Microsoft, great OS's, but the languages aren't very good IMO), has documentation without flexibility and while it apparently does graphics well, I doubt it has the sheer ability 'create-an-object-and-be-done-five-lines-later' that java has, and seems to be missing the button drag n' drop ability that you want, while I KNOW that somewhere, Java has a drag and drop interface for components, though I haven't been able to find it:P

And yes, I do realize I'm biased, spending 6 months straight of 4 hours a day when you are still in high school writing a java program will do that   ohmy
Logged

So you came along and found Java(insert programming language here)? Randomly?  Well then, you're just like me! Java fiends rule.  (Though other languages do have their uses.)
f0dder
Charter Honorary Member
***
Posts: 8,774



[Well, THAT escalated quickly!]

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #9 on: December 15, 2009, 01:17:30 AM »

Java is nice and all, but oh god the development environments I've tried (Eclipse and NetBeans) have their quirks - especially when it comes to GUI designers, which are quirky beyond reason... an the debuggers absolutely suck compared to what Visual Studio has. The refactoring support is nice, though, and possible because Java is so much simpler to parse than C++.

Since you've done VB, well, I'd say go for that - it's pretty darn fast to do GUIs in. Sounds like a somewhat weird thing you want to design, btw smiley
Logged

- carpe noctem
CodeTRUCKER
Supporting Member
**
Posts: 1,024



Bush Flying... where I'd rather be.

see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #10 on: December 15, 2009, 08:03:16 PM »

Java is nice and all, but oh god the development environments I've tried (Eclipse and NetBeans) have their quirks - especially when it comes to GUI designers, which are quirky beyond reason... an the debuggers absolutely suck compared to what Visual Studio has. The refactoring support is nice, though, and possible because Java is so much simpler to parse than C++.  

Since you've done VB, well, I'd say go for that - it's pretty darn fast to do GUIs in.

Thanks for the comments.  As it turns out, I was cleaning out a room and re-discovered a never-opened Visual Studio 2005 (Standard Ed.) prize I won for attending some MS webinars some time back, but I have been considering the trade-off of the quickness of production in a visual IDE versus the intimacy the coder gains with the textual-type syntax/logic  

Quote
Sounds like a somewhat weird thing you want to design, btw smiley
Hmmmm...  that sounds like something that was probably said to Galilei, Leonardo, Thomas and Orville.   Wink
[/quote]
« Last Edit: January 01, 2011, 01:35:46 PM by CodeTRUCKER » Logged

I applaud those that refuse to commit "intellectual suicide."

Truth, unlike opinion, tradition, etc. will always be able to stand on its own.  Truth is not a static, but a living entity and will perpetually impart life; therefore, any "truth" that does not or can not impart life can not be Truth.

I am persuaded the only reason bad men have succeeded is not because good men have done nothing, but that good men did not do enough.

An Open Letter to My Friends


Notice: - Unless stated otherwise, I receive no compensation for anything I post here.
Stoic Joker
Honorary Member
**
Posts: 4,878



View Profile WWW Give some DonationCredits to this forum member
« Reply #11 on: December 15, 2009, 09:55:09 PM »

I was cleaning out a room and re-discovered a never-opened Visual Studio 2005 (Standard Ed.)
Now I'm not per-se superstitious ... but that sounds an awful lot like a sign to me... Wink

...I use MSVS2005 on an almost daily basis, it's a fine IDE me thinks!
Logged
f0dder
Charter Honorary Member
***
Posts: 8,774



[Well, THAT escalated quickly!]

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #12 on: December 16, 2009, 09:39:38 AM »

but I have been considering the trade-off of the quickness of production in a visual IDE versus the intimacy the coder gains with the textual-type syntax/logic
Save the "real programming" for where it matters, not using visual designers for your GUI code is a waste of time... trust me. (I still do some of my GUI coding in raw Win32 API, so I know what I'm talking about tongue)

Sounds like a somewhat weird thing you want to design, btw smiley
Hmmmm...  that sounds like something that was probably said to Mr. Galilei, Leonardo, Thomas and Orville.   Wink
undecided undecided undecided
Logged

- carpe noctem
CWuestefeld
Supporting Member
**
Posts: 911



see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #13 on: December 16, 2009, 02:00:00 PM »

This isn't actually a language question. It's a platform question. For example, the difficulty of doing this in C++ is wildly different depending on whether you're using Win32 API or MFC; when using Java, it differs much if you use Swing vs. SWT. And conversely, if you use .Net WinForms, the experience is the same whether you're using C# or VB.

The resizing of the button is probably trivial in any modern GUI platform. Your requirement to shift around other buttons is a somewhat larger challenge. If these aspects are your primary driver, then I'd focus on a GUI platform that offers some sort of layout manager. I know that such beasts exist for Java, and I've used them extensively under .Net's native WinForms classes. With .Net you get the language choice of C# or VB (and a few others).

Using the .Net WinForms layout managers, you can select from different layout strategies. There are a couple that might make good sense for you. One is the table layout, where you place objects just as you would in an HTML table, by assigning them to rows and columns. There's also a layout (unfortunately I forget the name) that flows your layout similar to the way HTML object (say, paragraphs with images in and around them) get shifted around, as when you resize your browser window.
Logged



CodeTRUCKER
Supporting Member
**
Posts: 1,024



Bush Flying... where I'd rather be.

see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #14 on: December 16, 2009, 02:25:28 PM »

Quote
Save the "real programming" for where it matters, not using visual designers for your GUI code is a waste of time... trust me. (I still do some of my GUI coding in raw Win32 API, so I know what I'm talking about tongue)
I agree there is nothing to be gained by reinventing the wheel.

Quote
undecided undecided undecided
Me too, but I won't know until I try.  smiley

[Edit - Formatting.]
« Last Edit: December 17, 2009, 09:25:58 AM by CodeTRUCKER » Logged

I applaud those that refuse to commit "intellectual suicide."

Truth, unlike opinion, tradition, etc. will always be able to stand on its own.  Truth is not a static, but a living entity and will perpetually impart life; therefore, any "truth" that does not or can not impart life can not be Truth.

I am persuaded the only reason bad men have succeeded is not because good men have done nothing, but that good men did not do enough.

An Open Letter to My Friends


Notice: - Unless stated otherwise, I receive no compensation for anything I post here.
CodeTRUCKER
Supporting Member
**
Posts: 1,024



Bush Flying... where I'd rather be.

see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #15 on: December 16, 2009, 02:27:14 PM »

Quote
This isn't actually a language question. It's a platform question.
...

Hey CWuestefeld, thanks for framing a context for me.  After some careful consideration of what I am actually trying to do, your comments and the above input I have to recognize that what I want to do and what I can do are too far apart at this time.  I might try it for NANY 2011, but with only two-weeks until my deadline, I would not be able to produce an alpha, much less a finished product.  I am going to put that project in the vault for the present.  I will see about reviving this thread (if necessary) in Q2/Q3 of next year. 

Everyone, I appreciate all the help!  You have kept me from beating my head against the wall unnecessarily.   
Logged

I applaud those that refuse to commit "intellectual suicide."

Truth, unlike opinion, tradition, etc. will always be able to stand on its own.  Truth is not a static, but a living entity and will perpetually impart life; therefore, any "truth" that does not or can not impart life can not be Truth.

I am persuaded the only reason bad men have succeeded is not because good men have done nothing, but that good men did not do enough.

An Open Letter to My Friends


Notice: - Unless stated otherwise, I receive no compensation for anything I post here.
Ehtyar
Supporting Member
**
Posts: 1,236



That News Guy

see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #16 on: December 16, 2009, 06:38:07 PM »

MFC is dying a slow, agonizing death. If you're interested in using C++ w/ GUIs, consider trying wxWidgets or Qt. Both have excellent GUI designers and are cross-platform (which may or may not be a benefit).

C#/VB.NET have similar benefits though VS and Mono, though VB.NET bares little similarity to VB 6, and is often abandoned by more seasoned developers for the more logical (and some argue more powerful) syntax of C#.

Ehtyar.
Logged
PPLandry
Supporting Member
**
Posts: 691


see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #17 on: February 26, 2010, 11:48:34 PM »

Ok, does that sound doable in your language?  

Way back in 1995, I was given a mandate by the National Reseach Council of Canada to do just that. It was called ScreenSurvey. Using VB (version 3 IIRC), there as a module to design forms with GUI elements (buttons, checkboxes, etc). Another module would run the admin-designed forms on a pre-defined schedule. Data entered by end-users (in those admin-designed forms) was stored on a network for later analysis.

It is still available on their web-site:
http://www.nrc-cnrc.gc.ca...c/task-performance.html#5

I still have the source code (but I don't own it)

IIRC correctly, VB supports control arrays (something that was dropped in VB.net). So simply create 1 instance of every VB GUI element, give it an index (it then becomes an array), set Visible=false and you're all set to create new controls using code.
« Last Edit: February 26, 2010, 11:50:40 PM by PPLandry » Logged

Real generosity toward the future lies in giving all to the present -- Albert Camus -- www.InfoQube.biz
Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.048s | Server load: 0.05 ]