We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello,
I'm trying to put together a Menu for applications exported Processing, but I'm having trouble, I'll try to explain.
For example, I exported several sketches for Windows application (application for Export option), when I open executable by Windows Explorer, works normal perfectly.
But when I try to use another program to make the call executable, does not open, for example, created a program in Delphi to make the call of the executable in processing, to use only a set menu.
The question then would be: It is possible through the Processing using multiple independent sketches? I could create a type of menu, just to make the call to other programs?
Thanks in advance and excuse the English, I'm escrenvendo with the help of Google translator ...
Thanks,
Answers
Hello again,
Trying to better convey the idea annexed is the program print I made in Delphi, just to make the call to the executable as select the picture, open the animation ...
I did some tests with openFrameworks, works well to make the call, but had some problems to work using shapes, design quality was not as good as in Processing, so the idea of creating a direct Menu it ...
Thank you,
Hello, I again ...
Moving on previous experience, I tried to use a menu options using the Controlp5 library, even managed to do something, but the code was getting too complicated to manipulate the extent that increased the options.
So the idea of letting each separate sketch, the medium I found was exporting, and then do something to make the call of each independent.
So would program01, program02, program03 ... etc ..
Ha yes, this project aims to be a "kind of workshop" where the idea is to give chance to a person who has restricted movement (in a wheelchair for example) and with minimal movement, through the Arduino or direct the processing, connecting devices to interact, thus giving the possibility of "a bit of fun", and even assist in physical therapy ...
Thank you very much for now ...
I was reading this a few times now and still hard to grasp what you want---
you can use open() to run an exe-file (under windows they are called this) so your menu would have different open() calls to other sketches you already exported (paths must be full and right)
you can join your sketches into one. All classes all functions. One setup() where you join all previous setups and one draw() where the menu decides which sub-sketch to run.... using states.
when you want I can provide a demo
;-)
Hello,
Thanks for the feedback, truly believe that should have had some trouble understanding what I'm trying to say, it's the same when I translate the original texts in English ... My native language is Portuguese, I live in Brazil ...
Anyway, but you get exactly what I'm intending to do, which is to create a Menu to call the various scketch separately.
I tried to do in a single sketch, with control by choice (states) but it gets a little complicated to deal with all this, as it increases the options.
I managed to solve the problem by exporting each sketch, and then built a program just to make the call, and is working as expected.
Annex has a print of how was the application, each image draws the corresponding schetch, and ease of use ...
Many of the sample took the OpenProcessing site ...
Thank you,
so you made it!
Great!
Can you show us the program that you built just to make the call?
;-)
tchii eu tambem tenho esse problema, mete ai o codigo please!!
Hello Chrisir,
It was a middle solution "improvised", after all did the Menus in Delphi (which is a language that I schedule some time, I'm starting with Processing), calling each exe exported by Processing ... but it was functional ...
Thanks for the feedback,
thank you
Sorry, I did not understand what they wanted ...
In fact I did it in Delphi, which is relatively simple, because in Delphi has the ease of working with native components, to call to other programs, split tabs, etc ...
But in Processing we have the facildade to work with animation / interaction, so to use what one has to "best" ...
I do not know if it will help ... but I'm leaving attached the sources, it was compiled in Delphi 2006, but may be in another version.
Each sketch in Processing was exported (In File menu, Export Application), and in Delphi I called each as "click" on the image.
I set a folder where the exported executable, in my case is in:
'D:\Projetos\Exe\Processing'
No caso esta pasta ( Processing ) se observarem, além dos executáveis, tem a pasta lib, que são os arquivos .jar
Annex are also executable exported Processing, as well as the sources ... as mentioned before, most sources are extracted from OpenPrecessing site.
Notes: The examples that use Kinect is not opening the exported executable, must be direct even to the Processing function.
And as I said, excuse my english ... in verdar is google translator ...
If you need help, I will gladly share something that can help ...
Thank you,
thank you!
;-)
Hmmm ... is to attach files in Post?
It means "ugly" so the code in Delphi, but I'll put here ... in the case would have to create a project in Delphi, and "Paste" this code in the form (pas) ...
If quizerem to send the attached project, ask this email: j.aparecido.p@gmail.com
Code in Delphi
interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, Buttons, ExtCtrls, StdCtrls, ComCtrls, jpeg, ShellApi;
type TfrmMenu = class(TForm) PageControl1: TPageControl; TabSheet1: TTabSheet; lblTitulo: TLabel; ScrollBox1: TScrollBox; TabSheet2: TTabSheet; Panel3: TPanel; Image2: TImage; Panel1: TPanel; Image3: TImage; Panel2: TPanel; Label2: TLabel; Panel4: TPanel; Image1: TImage; Panel5: TPanel; Image4: TImage; Panel7: TPanel; Image6: TImage; Panel8: TPanel; Image7: TImage; TabSheet3: TTabSheet; TabSheet4: TTabSheet; TabSheet5: TTabSheet; Panel9: TPanel; Image8: TImage; Panel10: TPanel; Image9: TImage; Panel11: TPanel; Image10: TImage; Panel12: TPanel; Image11: TImage; Panel16: TPanel; Image15: TImage; Panel17: TPanel; Image16: TImage; Panel6: TPanel; Image5: TImage; Panel20: TPanel; Image19: TImage; Panel21: TPanel; Image20: TImage; Panel14: TPanel; Image13: TImage; Panel13: TPanel; Image99: TImage; procedure Image99Click(Sender: TObject); procedure Image13Click(Sender: TObject); procedure Image20Click(Sender: TObject); procedure Image19Click(Sender: TObject); procedure Image5Click(Sender: TObject); procedure Image15Click(Sender: TObject); procedure Image14Click(Sender: TObject); procedure Image12Click(Sender: TObject); procedure Image11Click(Sender: TObject); procedure FormCreate(Sender: TObject); procedure Image10Click(Sender: TObject); procedure Image9Click(Sender: TObject); procedure Image8Click(Sender: TObject); procedure Image7Click(Sender: TObject); procedure Image6Click(Sender: TObject); procedure Image4Click(Sender: TObject); procedure Image1Click(Sender: TObject); procedure FormKeyPress(Sender: TObject; var Key: Char); procedure Image2Click(Sender: TObject); procedure Image3Click(Sender: TObject); private { Private declarations } function ExecExplorer(OpenAtPath: string; OpenWithExplorer, OpenAsRoot: Boolean): Boolean; procedure CloseForm(Caption: String); procedure ExecutaPrograma(sExecutavel, sCaminho: String); public { Public declarations } end;
var frmMenu: TfrmMenu; sCaminho: String;
implementation
{$R *.dfm}
procedure TfrmMenu.FormCreate(Sender: TObject); begin sCaminho := 'D:\Projetos\Exe\Processing'; end;
procedure TfrmMenu.FormKeyPress(Sender: TObject; var Key: Char); begin if Key = #13 then begin if not ( ActiveControl is TMemo ) then begin Key := #0; Perform( WM_NEXTDLGCTL,0,0 ); end; end else if Key = #27 then begin if MessageDlg('Confirma a Saída?', mtConfirmation, [mbYes, mbNo], 1) = mrYes then Close; end; end;
procedure TfrmMenu.Image10Click(Sender: TObject); begin ExecutaPrograma('asteroids.exe', sCaminho); end;
procedure TfrmMenu.Image11Click(Sender: TObject); begin ExecutaPrograma('Objetos_Ellipse01.exe', sCaminho); end;
procedure TfrmMenu.Image12Click(Sender: TObject); begin //ExecutaPrograma('Exemplo03.exe', sCaminho); ExecExplorer('D:\Kinect\Exemplos\Processing\Exemplo03\', True, True); end;
procedure TfrmMenu.Image13Click(Sender: TObject); begin ExecutaPrograma('Analisador_de_Sinal.exe', sCaminho); end;
procedure TfrmMenu.Image14Click(Sender: TObject); begin //ExecutaPrograma('Movimento_Dedos01.exe', sCaminho); ExecExplorer('D:\Kinect\Processing\Movimento_Dedos01\', True, True); end;
procedure TfrmMenu.Image15Click(Sender: TObject); begin ExecutaPrograma('Ellipse_Aceleracao02.exe', sCaminho); end;
procedure TfrmMenu.Image19Click(Sender: TObject); begin //ExecutaPrograma('Movimento_Dedos01.exe', sCaminho); ExecExplorer('D:\Kinect\Processing\Movimento_Corpo02\', True, True); end;
procedure TfrmMenu.Image1Click(Sender: TObject); begin ExecutaPrograma('Formas_Arte01.exe', sCaminho); end;
procedure TfrmMenu.Image20Click(Sender: TObject); begin ExecutaPrograma('Efeito_Som01.exe', sCaminho); end;
procedure TfrmMenu.Image2Click(Sender: TObject); begin try //lblTitulo.Enabled := False; //lblOpcao.Caption := 'Interação Ellipse';
finally //lblTitulo.Enabled := True; //lblOpcao.Caption := ''; end; end;
procedure TfrmMenu.Image3Click(Sender: TObject); begin try //lblTitulo.Enabled := False; //lblOpcao.Caption := 'Pressione a Tecla R para recomeçar...'; //lblOpcao.Refresh;
finally //lblTitulo.Enabled := True; //lblOpcao.Caption := ''; end; end;
procedure TfrmMenu.Image4Click(Sender: TObject); begin ExecutaPrograma('Formas_Artes03.exe', sCaminho); end;
procedure TfrmMenu.Image5Click(Sender: TObject); begin //ExecutaPrograma('Movimento_Dedos01.exe', sCaminho); ExecExplorer('D:\Kinect\Processing\Movimento_Corpo01\', True, True); end;
procedure TfrmMenu.Image6Click(Sender: TObject); begin ExecutaPrograma('Formas04.exe', sCaminho); end;
procedure TfrmMenu.Image7Click(Sender: TObject); begin ExecutaPrograma('Ellipse_Aceleracao.exe', sCaminho); end;
procedure TfrmMenu.Image8Click(Sender: TObject); begin ExecutaPrograma('Animacao_Interacao.exe', sCaminho); end;
procedure TfrmMenu.Image99Click(Sender: TObject); begin ExecutaPrograma('Animacao_Interacao.exe', sCaminho); end;
procedure TfrmMenu.Image9Click(Sender: TObject); begin ExecutaPrograma('fireworks01.exe', sCaminho); end;
procedure TfrmMenu.ExecutaPrograma( sExecutavel, sCaminho: String); begin try ShellExecute (Application.Handle, 'open', PChar(sExecutavel), '', PChar(sCaminho), SW_SHOWNORMAL); //SW_SHOWMAXIMIZED except MessageDlg( 'Erro ao Abrir Programa! Tente novamente...',mtInformation,[mbOK],0 ); end; end;
function TfrmMenu.ExecExplorer(OpenAtPath: string; OpenWithExplorer, OpenAsRoot: Boolean): Boolean; var s : string; begin if OpenWithExplorer then begin if OpenAsRoot then s := ' /e,/root,"' + OpenAtPath + '"' else s := ' /e,"' + OpenAtPath + '"'; end else s := '"' + OpenAtPath + '"';
Result := ShellExecute(Application.Handle, PChar('open'), PChar('explorer.exe'), PChar(s), nil, SW_NORMAL) > 32; end;
procedure TfrmMenu.CloseForm(Caption: String); var h: THandle; begin while (True) do begin h := FindWindow(nil, PChar(Caption));
end; end;
{ //Testes para abertura de executável
}
end.>
Unfortunately did not yield to send the attachment, to see how the test was, but as I said, if there is any way to send attachment on the site, please report thus gives to get a better idea.
Sincerely,
thank you!
http://forum.processing.org/two/discussion/8045/how-to-format-code-and-text
Hello Chrisir,
I'm trying to make this menu Call in Java, may be more familiar for those who program in Processing, if it works well, then post here ...
Perhaps you should take a peek at @druid's discussion for other multiple windows techniques:
http://forum.processing.org/two/discussion/10937/multiple-sketches
Hello,
Thanks for the tip, appears to be functional in this way, I better study the code ...
Actually, I was thinking of putting together a sketch menu only, may be able to leave each call a new "tab" separate, and call each one on an individual moment.
I will check better, then post the results here ...
thank you very much
also see
http://forum.processing.org/two/discussion/comment/43341/#Comment_43341
Hello Chrisir,
Thanks for return again ... so it was much more "clean" code, can you use perfectly.
One question in the case when you use buttons, you can load an image "inside" of it?
... Just as observations, I made a controlled program option (state) as earlier suggestion, got a little "monster", but it was pretty cool operation, has four options, which changes some things, sharing the same class.
It is that also put the libraries to capture audio from the microphone, Kinect, and all simultaneously by was slightly complex code ...
This way gives to organize better, and let the friendliest code ...
Thanks,
Thanks a lot!
you can load images in the buttons...
see e.g.
some of my posts here....
http://forum.processing.org/two/discussion/10969/liste-view-3d-object#latest
Hello Chrisir,
Thanks for the link to the example ...
Maybe I did not express myself well, what you mean is whether the Menu button could be used, a close example of this is how this other link that you indicated:
http://www.openprocessing.org/sketch/77843
But from what you can see, does not use button, but rectangles .. although in practice it seems are similar, in another example, it seems to give better control the application.
I will try to adapt in this way in the programs I'm doing, then post here some news.
thank you very much
you can also use image()
Hello Chrisir,
Sorry, only post now ...
The idea is that, instead of text on the button, use an image thus intuitively, the person choose the option you want.
I'm adapting the model you suggested, then you could do something more concrete
thank you very much
here comes a version with images.
the images must be in the sketch folder.
they must be called 0.jpg, 1.jpg, 2.jpg (exactly like that)
did you mean that?
;-)
Oh yes, perfect, exactly what we were trying to do ...
Thank you very much for the time being, I now start developing a project, the way I was thinking.
Abusing a little (laughs ...) I will open another topic, making reference to another, it would be the sequence of work, about voice library ... but as I said, I will further explain the idea in another Post .
Thank you very much. :) :)
great!
all images are set to
sizeButton x sizeButton
45 x 45 atm
;-)
Hello Chrisir,
I had faced me with this problem, and had to make an adjustment on the images to stay cool ...
Follows a print to get an idea of how the project is getting. I found it interesting load the buttons changing positions at random.
The tip of the programs call the function separately draw was very good ... I'm leaving each program in a "tab" separate, so the code is more organized.
Has a lot more things to see, as I mentioned before, we are developing this project seeking in order to use for people with limited mobility, such as a wheelchair for example ... and even with limited movement of hands, can do some kind of interaction with the computer ...
So the idea of using multiple devices as input, such as mouse, microphone, Kinect, Arduino, etc ...
To control what device I'm using, I made a similar validation of programs in the draw function.
Not everything is working yet, but this is getting much foma be structured.
Below is a code snippet of how it's getting (the comenáriois are in Portuguese ... sorry ... rsss ...)
Thank you very much for now ... ;)

Code snippet (draw function)
sounds great!