Forums
This topic is locked
Multiple Dialog box from floaters
Posted 11 Aug 2001 20:57:04
1
has voted
11 Aug 2001 20:57:04 Bruno Mairlot posted:
Hi,I have a floaters that works fine. But when I want to perform a action on the current document I need to know some information from the user. Up to now I've made a series of Pop-Up prompt() dialog box. But it isn't very user-friendly.
My goal is to create a full dialog box, with different fields to let the user define everything at once from the floater.
I've tried to define layer and work with the visibility style, but it doesn't work very well.
Any idea on how to do this ?
"First they laugh at you, then they fight you, then you Win..." Ghandi
Replies
Replied 12 Aug 2001 15:47:13
12 Aug 2001 15:47:13 Paul R Boon replied:
Maehdros
The way i would solve this is to design a command to handle the user input, then from a button within the floater run the command using the api call.
dw.runCommand('mycommandfile.htm');
when the user press the ok buton on the dialog call a function that will use DWfile.write() to write a file containing your settings.
Then in the floater call a function using DWfile.read() to read these settings .
For Example:
For the floater:-
var fileURL = dreamweaver.getConfigurationPath()+"/Shared/Maehdros/dialogSettings.xml";
function displayDialog(){
// Display dialog for user input.
dw.runCommand('pd_unzip_files.htm');
// After dialog has closed check for existence of settings file.
if (DWfile.exists(fileURL)){
// as the file exists read the file into a string
var str =DWfile.read(fileURL);
//process the string with the processFileFunction.
processFileFunction(str);
}
}
For the Command:-
var fileURL = dreamweaver.getConfigurationPath()+"/Shared/Maehdros/dialogSettings.xml";
function commandButtons(){
return new Array("OK","saveSettings();","Cancel","window.close()"
}
function saveSettings(){
//assuming you have all data ready in a string by now called settingStr
var settingStr= profcessDialogInput();
//
DWfile.write(fileURL,settingStr);
window.close();
}
Hopes This Helps
Paul R Boon
The way i would solve this is to design a command to handle the user input, then from a button within the floater run the command using the api call.
dw.runCommand('mycommandfile.htm');
when the user press the ok buton on the dialog call a function that will use DWfile.write() to write a file containing your settings.
Then in the floater call a function using DWfile.read() to read these settings .
For Example:
For the floater:-
var fileURL = dreamweaver.getConfigurationPath()+"/Shared/Maehdros/dialogSettings.xml";
function displayDialog(){
// Display dialog for user input.
dw.runCommand('pd_unzip_files.htm');
// After dialog has closed check for existence of settings file.
if (DWfile.exists(fileURL)){
// as the file exists read the file into a string
var str =DWfile.read(fileURL);
//process the string with the processFileFunction.
processFileFunction(str);
}
}
For the Command:-
var fileURL = dreamweaver.getConfigurationPath()+"/Shared/Maehdros/dialogSettings.xml";
function commandButtons(){
return new Array("OK","saveSettings();","Cancel","window.close()"
}
function saveSettings(){
//assuming you have all data ready in a string by now called settingStr
var settingStr= profcessDialogInput();
//
DWfile.write(fileURL,settingStr);
window.close();
}
Hopes This Helps
Paul R Boon
Replied 12 Aug 2001 17:01:43
12 Aug 2001 17:01:43 Bruno Mairlot replied:
This is indeed what I had though to do.
I wasn't sure though how to get the info back from the dialog, but files might be effectively a good way to store information between different "extension".
But now, suppose I package the floater and the dialog box together I'll have two distinct extension, but the command one won't do nothing but write a file, which might be a little unuseful for the user.
How can I prevent the user to access the command extension ? If I don't include any UI control, it should be ok, but is it permitted by DW ? (Note : I'll try it)
BTW I suppose it can work for as many dialog as I want, no ?
"First they laugh at you, then they fight you, then you Win..." Ghandi
I wasn't sure though how to get the info back from the dialog, but files might be effectively a good way to store information between different "extension".
But now, suppose I package the floater and the dialog box together I'll have two distinct extension, but the command one won't do nothing but write a file, which might be a little unuseful for the user.
How can I prevent the user to access the command extension ? If I don't include any UI control, it should be ok, but is it permitted by DW ? (Note : I'll try it)
BTW I suppose it can work for as many dialog as I want, no ?
"First they laugh at you, then they fight you, then you Win..." Ghandi
Replied 12 Aug 2001 17:25:02
12 Aug 2001 17:25:02 Paul R Boon replied:
Add:
<!-- MENU-LOCATION=NONE -->
to the command on the very first line of the file, this will stop the command appearing in the commands menu (or any menu).
using commands or more than one dialog is an excepted and functional way of breaking up an extension, after all no one said an extension needs to be all in one file.
<!-- MENU-LOCATION=NONE -->
to the command on the very first line of the file, this will stop the command appearing in the commands menu (or any menu).
using commands or more than one dialog is an excepted and functional way of breaking up an extension, after all no one said an extension needs to be all in one file.
Replied 12 Aug 2001 19:53:25
12 Aug 2001 19:53:25 Waldo Smeets replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>using commands or more than one dialog is an excepted and functional way of breaking up an extension, after all no one said an extension needs to be all in one file.<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
True, when you have a look at some advanced Macromedia dialog boxes you will notice that they very often 'get back to' commands when they need it. When I remember it correctly also the recordset dialog box uses a command. And so do several Live Objects and lots of other extensions.
Commands are so usefull because they are not as limited as other files (correct me when I am wrong).
Waldo Smeets - www.UDzone.com Webmaster
<font size=1>-------------------------------------------
<i>Please read the Forum FAQ before posting
a question to this TalkZone.</i>
-------------------------------------------
www.UDzone.com : A dynamic Dreamweaver,
Ultradev and Fireworks site for developers
by developers.
-------------------------------------------</font id=size1>
True, when you have a look at some advanced Macromedia dialog boxes you will notice that they very often 'get back to' commands when they need it. When I remember it correctly also the recordset dialog box uses a command. And so do several Live Objects and lots of other extensions.
Commands are so usefull because they are not as limited as other files (correct me when I am wrong).
Waldo Smeets - www.UDzone.com Webmaster
<font size=1>-------------------------------------------
<i>Please read the Forum FAQ before posting
a question to this TalkZone.</i>
-------------------------------------------
www.UDzone.com : A dynamic Dreamweaver,
Ultradev and Fireworks site for developers
by developers.
-------------------------------------------</font id=size1>
Replied 16 Aug 2001 15:06:13
16 Aug 2001 15:06:13 Bruno Mairlot replied:
Hi again,
I've succesfully created a command that interact with my floater.
But now I would like to know how do I a package all these extension into a suite of extension. I know it is a matter of MXI file, but it's not easy to find info or doc about creating a suite of extension.
I've tried some trick in xml but I can't see nothing but the first extension...
BTW, this is for the extension PHP Form Info.
"First they laugh at you, then they fight you, then you Win..." Ghandi
I've succesfully created a command that interact with my floater.
But now I would like to know how do I a package all these extension into a suite of extension. I know it is a matter of MXI file, but it's not easy to find info or doc about creating a suite of extension.
I've tried some trick in xml but I can't see nothing but the first extension...
BTW, this is for the extension PHP Form Info.
"First they laugh at you, then they fight you, then you Win..." Ghandi
Replied 16 Aug 2001 19:23:51
16 Aug 2001 19:23:51 Joel Martinez replied:
have you thought about the MXI File generator from Public domain?
Joel Martinez
----------
set rs = conn.execute("SELECT answer FROM brain WHERE question = "& forumPost &"
Joel Martinez
----------
set rs = conn.execute("SELECT answer FROM brain WHERE question = "& forumPost &"
Replied 16 Aug 2001 19:31:58
16 Aug 2001 19:31:58 Bruno Mairlot replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
have you thought about the MXI File generator from Public domain?
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Yes, I've got this extension. (Which is great), but it doesn't give exactly what I want.
Actually I had to fully understand some concepts that I didn't need before. And it worked fine.
Just to be sure that I it is correct, let me explain what I understood :
Extension are plain files, and the MXI file is only a way to tell the packager which file I need and where to place them. This is the place of the file that determines the extension type (is it right ?)
I first made a "command" extension. So the macromedia-extension type value was "command", but after I finished the first command, I designed a second one,then added the new htm file to to <file-item> section, and changed the type to "suite".
It seems to works, but I'm not sure of what is going to happen when I'll package the Floater within...
Does I have to only include the floater file and put it on Configuration/Floaters/ directory to be recognized as a floater ?
"First they laugh at you, then they fight you, then you Win..." Ghandi
Edited by - Maehdros on 08/16/2001 19:32:38
have you thought about the MXI File generator from Public domain?
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Yes, I've got this extension. (Which is great), but it doesn't give exactly what I want.
Actually I had to fully understand some concepts that I didn't need before. And it worked fine.
Just to be sure that I it is correct, let me explain what I understood :
Extension are plain files, and the MXI file is only a way to tell the packager which file I need and where to place them. This is the place of the file that determines the extension type (is it right ?)
I first made a "command" extension. So the macromedia-extension type value was "command", but after I finished the first command, I designed a second one,then added the new htm file to to <file-item> section, and changed the type to "suite".
It seems to works, but I'm not sure of what is going to happen when I'll package the Floater within...
Does I have to only include the floater file and put it on Configuration/Floaters/ directory to be recognized as a floater ?
"First they laugh at you, then they fight you, then you Win..." Ghandi
Edited by - Maehdros on 08/16/2001 19:32:38
Replied 16 Aug 2001 19:38:38
16 Aug 2001 19:38:38 Waldo Smeets replied:
Yes. The name 'suite' etc is only for a quick overview in the Extension Manager and does not influence the extension at all.I would name it floater when the command are only used to support the floater and are not accessable from the normal commands menu. When it really are multiple tools you could cal it suite.
Waldo Smeets - www.UDzone.com Webmaster
<font size=1>-------------------------------------------
<i>Please read the Forum FAQ before posting
a question to this TalkZone.</i>
-------------------------------------------
www.UDzone.com : A dynamic Dreamweaver,
Ultradev and Fireworks site for developers
by developers.
-------------------------------------------</font id=size1>
Waldo Smeets - www.UDzone.com Webmaster
<font size=1>-------------------------------------------
<i>Please read the Forum FAQ before posting
a question to this TalkZone.</i>
-------------------------------------------
www.UDzone.com : A dynamic Dreamweaver,
Ultradev and Fireworks site for developers
by developers.
-------------------------------------------</font id=size1>