ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Other Software > Developer's Corner

Can Buttons be Dynamically Moved, Resized, etc. in Your Language?

(1/4) > >>

CodeTRUCKER:
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.

Stoic Joker:
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... ;)

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.

SingingBoyo:
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.

CodeTRUCKER:
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... ;)

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.
-Stoic Joker (December 11, 2009, 06:01 PM)
--- End quote ---

Sorry, I'm not the only one involved, you know... some of the NDA stuff.  ;)   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?

CodeTRUCKER:
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.
-SingingBoyo (December 11, 2009, 06:17 PM)
--- End quote ---

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."

Navigation

[0] Message Index

[#] Next page

Go to full version