by marceros » Wed Aug 17, 2022 3:40 am
Hello!
My program looks stable and does the main logics of the job. Before I write the next question/problem, I'd like to explain in a line or two what the program does.
I added a menu in the MM5 main window that opens a second window. Following is the code in the actions_add.js
Code: Select all
actions.openDanceFloorDisplay = {
title: _('Dance floor display') + '...',
hotkeyAble: true,
// icon: 'openDanceFloorDisplay',
// disabled: uitools.notMediaListSelected,
visible: window.uitools.getCanEdit,
execute: async function () {
var dlg = uitools.openDialog('dlgDanceFloorDisplay', {
left: 100,
top: 100,
width: 500,
height: 500,
show: true,
modal: false,
title: _('Dance floor display'),
// tracks: list
});
}
}
That window goes to a second screen and displays information (to the people in the dance floor) about the theme that is playing and the following themes. All the logic is done in the JS of the open dialog and that's the part that I'm happy with.
Now I need to control the dialog from outside - from the main MM menu. Let's say that the second screen is different than expected and I have to change some internal parameters that control the text size and the height of the lines. Or I might want to change the text of the first line (title) showing on the second screen.
I guess the question is how I send data to the dialog JS (dlgDanceFloorDisplay.js) and how I run an update function in that JS, everything initiated from a menu in the main MM window.
Thank you in advance,
Marcelo
Hello!
My program looks stable and does the main logics of the job. Before I write the next question/problem, I'd like to explain in a line or two what the program does.
I added a menu in the MM5 main window that opens a second window. Following is the code in the actions_add.js
[code]
actions.openDanceFloorDisplay = {
title: _('Dance floor display') + '...',
hotkeyAble: true,
// icon: 'openDanceFloorDisplay',
// disabled: uitools.notMediaListSelected,
visible: window.uitools.getCanEdit,
execute: async function () {
var dlg = uitools.openDialog('dlgDanceFloorDisplay', {
left: 100,
top: 100,
width: 500,
height: 500,
show: true,
modal: false,
title: _('Dance floor display'),
// tracks: list
});
}
}
[/code]
That window goes to a second screen and displays information (to the people in the dance floor) about the theme that is playing and the following themes. All the logic is done in the JS of the open dialog and that's the part that I'm happy with.
Now I need to control the dialog from outside - from the main MM menu. Let's say that the second screen is different than expected and I have to change some internal parameters that control the text size and the height of the lines. Or I might want to change the text of the first line (title) showing on the second screen.
I guess the question is how I send data to the dialog JS (dlgDanceFloorDisplay.js) and how I run an update function in that JS, everything initiated from a menu in the main MM window.
Thank you in advance,
Marcelo