Source language: Translate to:

Object Copy Redux

Post your suggestions for future versions of NeoBook

Moderator: Neosoft Support

Object Copy Redux

Postby Enigman » Wed Jan 23, 2008 6:26 pm

I know this has been asked and discussed in the past, but I am going to bring it up again.

I have a need for the capability to copy an existing image object (or any object) and reposition it on a screen that will be printed. This would be a special music creation program for graphical notation of flute music.

The rest of the things I need, like moving and enable/disable, are already there. Of course that also requires a "delete object" command.

The previous threads I saw on this are REALLY old so this has been brewing for some time.

Is there an ETA for this feature?
User avatar
Enigman
 
Posts: 314
Joined: Tue Apr 12, 2005 3:57 pm
Location: Foothill Ranch, CA

Postby Gaev » Wed Jan 23, 2008 7:50 pm

Enigman:
I have a need for the capability to copy an existing image object (or any object) and reposition it on a screen that will be printed. This would be a special music creation program for graphical notation of flute music.
a) Are you asking for the creation of a new object at run time ... whose initial visual properties are identical to those of an existing object ?

b) Having stated the application for which this is required, what objects other than the Picture Object would be needed ? ... Button ? TextEntry ? ListBox ? WebBrowser ? Other ?

c) In addition to identical visual properties, do you need identical behaviour/responses for events like MouseClick ?

The rest of the things I need, like moving and enable/disable, are already there. Of course that also requires a "delete object" command.
What would be achieved by Deleting an object that would not be achieved by Disabling it and Hiding it (or moving it off screen) ?

On a typical page how many Picture (and other types of) Objects would be "so created at run time" ?
User avatar
Gaev
 
Posts: 3717
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Postby Enigman » Wed Jan 23, 2008 10:06 pm

Are you asking for the creation of a new object at run time ... whose initial visual properties are identical to those of an existing object ?


Yes. I could also use a simple "Add Object" and specify the properties, but in my application it would be much more expedient to copy an existing object.

Having stated the application for which this is required, what objects other than the Picture Object would be needed ? ... Button ? TextEntry ? ListBox ? WebBrowser ? Other ?


Most likely just the image, button, and label objects.

In addition to identical visual properties, do you need identical behaviour/responses for events like MouseClick


I haven't figured everything out, but it would be handy to be able to copy an entire group. If I did copy buttons, then the tricky part is individualizing the code so it addresses the object group containing the button. But the application could be done without buttons on the copied objects.

What would be achieved by Deleting an object that would not be achieved by Disabling it and Hiding it (or moving it off screen) ?


In the best case the program would be able to track multiple pages of flute notation. In the simple case the user would have to save a data file for each page and the program would treat them like unrelated pages.

If I don't have a function to delete unwanted objects, then the objects would just pile up off stage as edits were made and they would have to be tracked in some way. The only way to clear them would be exiting the program and reloading the data file on a restart.

On a typical page how many Picture (and other types of) Objects would be "so created at run time" ?


The program would create a series of simple flute line drawings on a page that represent notes in a song. This program could be achieved by having all the possible objects already created, but set to invisible and disabled. But here's the problem:

Each flute image would have six changeable finger holes. Each finger hole would have 7 possible states; off (invisible), open, 1/4 closed, 1/2 closed, 3/4 closed, fully closed, and unused. Each page has up to four lines of 20 flute images. In addition, between each flute image there are 6 possible joiners to link the finger holes together indicating a sustained note. Each joiner can have 5 possible states; off, solid, gradient up, gradient down, and "trill". There are 19 joiner positions in each of the 4 rows and 6 joiners per position. So the total is:

1 Flute = (1 outline + (6 holes x 7 states)) = 43 objects
1 joiner group = (6 positions x 5 states) = 30 objects

Total flute objects = (20 flutes per row x 4 rows x 43 objects per flute) = 3,440 objects
Total joiner objects = (19 positions per row x 4 rows x 30 objects per position) = 2,280 objects
Total objects = 3,440 + 2,280 = 5,720 objects to uniquely name and manage.

You can see the problem.

It doesn't matter if I have them offstage and move them in or if I have them in place and initially invisible. Without an object copy function they must all exist first.

Conversely, if I have an object copy command I only need 11 unique objects offstage. I can copy and place them and let the runtime code manage the object names as needed. Even at that the potential object count is 1,016 if the page is full. But reality is that flute songs are usually very short and would almost never fill the page with objects in all possible positions.
User avatar
Enigman
 
Posts: 314
Joined: Tue Apr 12, 2005 3:57 pm
Location: Foothill Ranch, CA

Postby Jay-Bird » Thu Jan 24, 2008 5:24 am

Could you use variables?


"1 Flute = (1 outline + (6 holes x 7 states)) = 43 objects
1 joiner group = (6 positions x 5 states) = 30 objects

Total flute objects = (20 flutes per row x 4 rows x 43 objects per flute) = 3,440 objects
Total joiner objects = (19 positions per row x 4 rows x 30 objects per position) = 2,280 objects
Total objects = 3,440 + 2,280 = 5,720 objects to uniquely name and manage."

Use jpg's or gif's for the holes and states... and use variables as placeholders , perhaps output to html using a table for outline and rows, then using variables you could place thousands of objects anywhere ...

Or use HPW's plugin hpwImage to do all of this... I havent used it much, but the possibilities are amazing from the little I have used it.

I think you can do what you are wanting using only a set of possible gif's, position gifs, etc and reuse them calling by variable(s) and arrays...

or I may just need more sleep.... :shock:

Jay
User avatar
Jay-Bird
 
Posts: 164
Joined: Fri Apr 01, 2005 7:01 am
Location: Louisiana , USA

Postby Gaev » Thu Jan 24, 2008 6:05 am

Enigman:

Thank you for the detailed response.

Total objects = 3,440 + 2,280 = 5,720 objects to uniquely name and manage.
I do not have any personal experience with that many objects in a single page (or pub) ... but this might cause some slower performance (responses) in older computers ... of course Dave is the best person to advise on that.

I know less about music than you know about "the mating habits of the aphids of Upper Limpopo" ... but going from your description ... perhaps you might consider "drawing your flute lines" on a different canvas ... one of ...

- Hans-Peter's imade rendering plug-ins
- an html document rendered inside a WebBrowser object
- PFlash (to be announced/released by Luis Pena by the end of this month) that uses an swf file within an html document that would also be rendered inside a WebBrowser object

... and once rendered, a snapshot of the canvas (via commands ; directly to a jpg file) can be achieved using ...

- another one of Hans-Peter's plugin
- a plugin I commissioned last year (to capture any region of the user's screen)


The above methods enable run time creation of "objects" (just not NeoBook objects) ... populating of images within them, placement and sizing ... and the entire canvas can be wiped clean with just one command.


Of course I would welcome the ability to create NeoBook objects at run time ... but that is for Dave to prioritize on his list for the next release of NeoBook.
User avatar
Gaev
 
Posts: 3717
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Postby Jay-Bird » Thu Jan 24, 2008 6:37 am

Gaev wrote:Of course I would welcome the ability to create NeoBook objects at run time ... but that is for Dave to prioritize on his list for the next release of NeoBook.


Not trying to horn in...but wouldn't that open new possibilities... :shock:

I can only imagine...And I understand why this may not be a good idea also :lol:

Jay
User avatar
Jay-Bird
 
Posts: 164
Joined: Fri Apr 01, 2005 7:01 am
Location: Louisiana , USA

Postby Neosoft Support » Thu Jan 24, 2008 11:57 am

The ability to create and destroy objects programmatically is under consideration for the next major update (v6?), but that is a ways in the future.

The complexity of your project makes my head hurt, but it seems like you might be able to use a matrix of picture objects to solve your problem (expanding on what Jay suggested). If there are a finite number of object states (off, open, 1/4 closed, 1/2 closed, etc.) then these could be depicted using images stored as embedded files. Then the appropriate image is loaded into each picture object in the matrix. This would be much easier to manage than thousands of objects.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5593
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Postby Enigman » Thu Jan 24, 2008 12:25 pm

Could you use variables?


They would have to be used regardless of the editing method to keep track of what's where.

Use jpg's or gif's for the holes and states... and use variables as placeholders


Yes, those would be the bulk of the objects, but the counts remain the same.

perhaps output to html using a table for outline and rows, then using variables you could place thousands of objects anywhere


Yes, this could be done, with two resulting additional problems:

1) The HTML would be tremendously complicated and have to precisely place thousands of images.
2) The editor would be batch oriented instead of WYSIWYG

Number 2 would make it tough for the composer to use the program and keep track of what they were doing.

There is another HTML option which is to skip the program and just make a big HTML table where you can click on parts of the images and have them change states. That would act like a WYSIWYG editor, you could print it or capture it to an image, but you wouldn't be able to save your editing for future editing. Leaving the page would mean starting over. The alternative to allow saves would be having a large SQL database behind it and use PHP to generate the page. But that means I have to host everyone's work and create vast numbers of databases. Not good.

Or use HPW's plugin hpwImage to do all of this... I havent used it much, but the possibilities are amazing from the little I have used it.


I'll check it out.

The reason I brought this topic up again is because as we have noted, there are a few ways of accomplishing what I want at this time. However, all of those are vastly complex scenarios and huge amounts of time investment for what would be a freebie program to allow people to use my style of flute song notation.

The notation is already easily made using the Visio files I have, but not so many people have Visio. I can also output a start file as an image that could be edited in any photo editor easily. Both of the above options require no time investment on my part. But many people can't manage either of these options.

Therefore, IF there was an object copy function I could make an editor with very little effort in NB. I would only need a dialog box that asks the row and column for the flute image and the states of the holes and joiners. Presto, it pops onto the screen and I write the data for that flute to the data file. The data file only needs 80 lines of data for a page. Then print screen, or capture to an image for web publishing and we're done and the editing is saved.

Without object copy, all scenarios are huge and I cannot devote the time to it.

I have seen threads on this function request dating back years and years. I have to wonder what the overhead would be to implement it and why it is on the back (or unlit) burner.

Any feedback, Dave?
User avatar
Enigman
 
Posts: 314
Joined: Tue Apr 12, 2005 3:57 pm
Location: Foothill Ranch, CA

Postby Enigman » Thu Jan 24, 2008 12:51 pm

Neosoft Support wrote:The complexity of your project makes my head hurt, but it seems like you might be able to use a matrix of picture objects to solve your problem (expanding on what Jay suggested). If there are a finite number of object states (off, open, 1/4 closed, 1/2 closed, etc.) then these could be depicted using images stored as embedded files. Then the appropriate image is loaded into each picture object in the matrix. This would be much easier to manage than thousands of objects.


But the problem is the same and it is still 1,280 empty image objects waiting for bitmaps to be assigned. Would you want to place and track 1,280 images at design time for the matrix?

The matrix is the same as the HTML scenario, except that the NB program would allow saves, but now the data file needs 1,280 lines instead of 80.

Just for reference, here is what one small line of the notation looks like and this is only one breath of playing 10 notes over 14 beats:

Image

Anything other than an object copy solution is huge. If I can copy image objects, they can be layered, thus avoiding the images having to be diced up into little chunks. I start with 11 unique image objects and no matrix is required. I know the spacing for the objects so I just plop the flute outline on screen, then layer holes on top, and joiners on top of that. Easy stuff. Anything else is not easy. :wink:
User avatar
Enigman
 
Posts: 314
Joined: Tue Apr 12, 2005 3:57 pm
Location: Foothill Ranch, CA

Postby Gaev » Thu Jan 24, 2008 4:25 pm

Enigman:
Yes, this could be done, with two resulting additional problems:

1) The HTML would be tremendously complicated and have to precisely place thousands of images.
2) The editor would be batch oriented instead of WYSIWYG

Number 2 would make it tough for the composer to use the program and keep track of what they were doing.
With all due respect, these statements are borne out of a lack of understanding of Dynamic HTML (dhtml) ... and the functionality Dave added in NeoBook v5.5 ... which allows the contents of a WebBrowser object to be dynamically altered using BrowserExecScript.

Take a lot at these demo publications of mine ...
http://www.scriptedlogic.com/neoFREE5.htm
http://www.scriptedlogic.com/neoFREE6.htm
... that exhibit the power of the BrowserExecScript command.

There is another HTML option which is to skip the program and just make a big HTML table where you can click on parts of the images and have them change states. That would act like a WYSIWYG editor, you could print it or capture it to an image, but you wouldn't be able to save your editing for future editing. Leaving the page would mean starting over. The alternative to allow saves would be having a large SQL database behind it and use PHP to generate the page. But that means I have to host everyone's work and create vast numbers of databases. Not good.
Not necessary to go this route at all.

I would only need a dialog box that asks the row and column for the flute image and the states of the holes and joiners. Presto, it pops onto the screen and I write the data for that flute to the data file. The data file only needs 80 lines of data for a page. Then print screen, or capture to an image for web publishing and we're done and the editing is saved.
It is possible to develop a couple of NeoBook Functions like ...

Call "enigDrawFluteHole" "[fluteRow]" "[fluteColumn]" "[StateHole1]" ... "[StateHole6]"
Call "enigDrawJoiner" "[fluteRow]" "[FluteColumn]" "[StatePos1]" ... "[StatePos6]"

... and invoke them after the Dialog Box is filled in and the OK button is clicked ... the functions would do the math to calculate locations of images relative to top left corner of (dummy) html document in WebBrowser ... and populate <img> objects with appropriate image files corresponding to Flute Hole and Joiner Positions ... could also be made to update database/file.

I have seen threads on this function request dating back years and years. I have to wonder what the overhead would be to implement it and why it is on the back (or unlit) burner.
At one time the concern was that providing the ability to create objects at run time could ... theoretically allow a developer to build a NeoBook (Lite) without the use of NeoBook (read without license payment to NeoSoft) ... a kind of cannibalizing feature.

Also, those that need to create an object at run time ... would also want to be able to specify all of its properties at run time ... NeoBook does not make all properties of all object available for change right now.

And there would be a requirement to specify event triggers for the newly minted objects ... also at run time.

while your particular need may not require all of these features, the discussions of the past covered them all.

Using objects created at Design time as "templates" ... as you are suggesting ... would meet some of the discussed requirements.
User avatar
Gaev
 
Posts: 3717
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Postby Enigman » Thu Jan 24, 2008 6:31 pm

With all due respect, these statements are borne out of a lack of understanding of Dynamic HTML (dhtml) ... and the functionality Dave added in NeoBook v5.5 ... which allows the contents of a WebBrowser object to be dynamically altered using BrowserExecScript.

Take a lot at these demo publications of mine ...
http://www.scriptedlogic.com/neoFREE5.htm
http://www.scriptedlogic.com/neoFREE6.htm
... that exhibit the power of the BrowserExecScript command.


Ignoring the small jibe and setting aside for a moment that I have been a full time web developer for 20 years, admittedly, I have not used a lot of dynamic image placement or layering in HTML. Javascript I have used extensively, though, for image swapping and control.

I tried the demos and I get a lot of runtime errors from number 5, enough that it doesn't function completely. However, enough of it functions that I can imagine that I might be able to do what I need without a table grid IF I can layer images at least three deep.

HOWEVER, and that's a big one, since I am not familiar with what it takes in javascript functions and NB functions working together to accomplish this I cannot quantify the investment required ... and we are right back to where we started.

When we add the learning curve to the equation when compared to using an "object copy" command directly in NB, then we are seemingly past the point of a worthwhile project for a freebie. I know exactly what it would take all in NB with object copy and it would be minimal.

If I could see code samples and I knew exactly what was needed I might change that, but for now it is a big unknown.

while your particular need may not require all of these features, the discussions of the past covered them all.


Yes, I could live with a strict object copy for this application.
User avatar
Enigman
 
Posts: 314
Joined: Tue Apr 12, 2005 3:57 pm
Location: Foothill Ranch, CA

Postby Gaev » Thu Jan 24, 2008 9:06 pm

Enigman:
Ignoring the small jibe
Jibe not intended ... the purpose of my post was to correct the notion you put out there regarding the use/shortcomings of the Webbrowser/HTML
... and setting aside for a moment that I have been a full time web developer for 20 years,
I have been working in the IT field for over 35 years ... doesn't mean I know everything about everything ... by my own choice, I know very little about Apple Computers, Java, c++ etc. etc. ... it is a long list ... but just because I can't do something in c++ does not mean that it can not be done with c++
I tried the demos and I get a lot of runtime errors from number 5, enough that it doesn't function completely.
What is your hardware/software configuration ... the same technology is used extensively in my Picture Puzzle games ... haven't heard of problems to date.
I might be able to do what I need without a table grid IF I can layer images at least three deep.
the z-index property determines the layering ... you can assign values from 1 to (at least) 100 ... probably more ... just haven't had reason to try it.
HOWEVER, and that's a big one, since I am not familiar with what it takes in javascript functions and NB functions working together to accomplish this I cannot quantify the investment required ... and we are right back to where we started.

When we add the learning curve to the equation when compared to using an "object copy" command directly in NB, then we are seemingly past the point of a worthwhile project for a freebie. I know exactly what it would take all in NB with object copy and it would be minimal.
Not trying to convert anyone ... given Dave's response about possible time frame for delivery of v6 ... just giving you an alternate option.
User avatar
Gaev
 
Posts: 3717
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Postby Enigman » Thu Jan 24, 2008 10:16 pm

I have been working in the IT field for over 35 years ... doesn't mean I know everything about everything ...

:lol: Which is why I chased my history with:

"admittedly, I have not used a lot of dynamic image placement or layering in HTML."

and then

"I can imagine that I might be able to do what I need without a table grid IF I can layer images at least three deep."

That would be me saying that it might actually work to try what you suggested. :wink:

So, ... any idea where I could find a sample of the javascript to place or move the images?

What is your hardware/software configuration ... the same technology is used extensively in my Picture Puzzle games ... haven't heard of problems to date.

I have a fairly new Dell 390 workstation at the office with XP Pro. I used WinZIP to open the zip file and used the internal "Check Out" process to extract all the files to a directory and make icons.

The first time I ran it I got errors when I touched any button and the images did not fill in. The next time the images filled in and there were less errors. The third time I only got errors if I tried to do the drag-n-drop demo. That remained consistent from there out.
User avatar
Enigman
 
Posts: 314
Joined: Tue Apr 12, 2005 3:57 pm
Location: Foothill Ranch, CA

Postby Gaev » Fri Jan 25, 2008 6:56 am

Enigman:

I am glad to have cleared up any misunderstandings ... didn't mean to "dis" anyone.

So, ... any idea where I could find a sample of the javascript to place or move the images?
The demo exe files are part of a complete (commercial) package that deploys ...

- (an Embedded) shell HTML file with a number of my custom built Javascript functions defined in its <head>...</head> section
- a few NeoBook Functions I developed ... so the actual requests to change (html) object properties is reduced to a single Call command
- heavy use of css loaded from (embedded) txt files

... however, in the next few days I will try and extract the basic requirements for your needs ...

- create an <img> object
- position it "relative to the top left corner of the document"
- size and populate it with one of the images

... and email to the address on your website.


While you might be able to print the document using BrowserPrint ... you might be better off ...

- taking a snapshot of the screen space occupied by the WebBrowser object ... as long as your composite image fits inside it and does not require scrolling
- and saving it to file
- then re-loading it into a Picture Object


BTW, if you want to learn the dhtml or css stuff, this is a pretty good place for it ... http://www.w3schools.com/dhtml/default.asp ... the properties important for your requirements are ...

position:absolute;
left:100px;
top:150px;
width:200px;
height:300px;
z-index:14;
src:abc.jpg;
User avatar
Gaev
 
Posts: 3717
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Postby Neosoft Support » Fri Jan 25, 2008 3:55 pm

I think you're overestimating the number of objects needed for my matrix suggestion. You shouldn't need separate objects for each of the hole and joiner group states. You could use one picture object for each hole and one for each joiner.

There are seven different state images for the holes and five for the joiner groups for a total of 12 images. Place these 12 images into the pub using the Book>Embedded Files option. You can then programmatically load the appropriate state image into the picture objects like this:

SetObjectFileName "Picture1" "[Embedded]Open.bmp"

You might even be able create a database that would populate the picture objects automatically.

This way the total object requirements are much more modest and the programming much simpler than hiding and showing or creating and deleting thousands of objects. With this method the total object requirements would be:

1 Flute = (1 outline + (6 holes)) = 7 objects
1 joiner group = (6 positions) = 6 objects

Total flute objects = (20 flutes per row x 4 rows x 7 objects per flute) = 560 objects
Total joiner objects = (19 positions per row x 4 rows x 6 objects per position) = 456 objects
Total objects = 1,016

That's still a lot of objects, but that's the same number you would have to manage if you created and deleted them programmatically.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5593
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Next

Return to NeoBook Suggestions

Who is online

Users browsing this forum: No registered users and 1 guest

cron