MessageBox configurator?

MessageBox configurator?

mgrenier1
Collaborator Collaborator
1,229 Views
8 Replies
Message 1 of 9

MessageBox configurator?

mgrenier1
Collaborator
Collaborator

Not sure if it could be useful in any kind of way but I tried building some kind of iLogic MessageBox configurator.

Now I'm wondering if it would be possible to like, save the MessageBox it spits out at the end as a template but I am not sure how to do it, I think the best way would be to save the output to another iLogic rule but how can I pass the value of the variables to another rule.

 

What do you guys think?

I know I could just write a new rule for every new MessageBox I need but where's the fun in that?

 

Dim Titre As String
Dim Message As String
Dim ListeIcon As New List(Of String)
ListeIcon.Add("Erreur")
ListeIcon.Add("Exclamation")
ListeIcon.Add("Informations")
ListeIcon.Add("Aucune")
ListeIcon.Add("Interrogation")
ListeIcon.Add("Arrêter")
ListeIcon.Add("Avertissement")
Titre = InputBox("Entrez le Titre", "Configurateur de Boite de messages", "Par Défaut")
Message = InputBox("Entrez le Message", "Configurateur de Boite de messages", "Par Défaut")
Icon = InputListBox("Choisir l'icone", ListeIcon, "", Title := "Configurateur de boite de message", ListName :="Icones")

	If Icon = "Erreur" Then
		MessageBox.Show(Message, Titre, MessageBoxButtons.OK, MessageBoxIcon.Error)
	ElseIf Icon = "Exclamation" Then
		MessageBox.Show(Message, Titre, MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
	ElseIf Icon = "Informations" Then
		MessageBox.Show(Message, Titre, MessageBoxButtons.OK, MessageBoxIcon.Information)
	ElseIf Icon = "Aucune" Then
		MessageBox.Show(Message, Titre, MessageBoxButtons.OK, MessageBoxIcon.None)
	ElseIf Icon = "Interrogation" Then
		MessageBox.Show(Message, Titre, MessageBoxButtons.OK, MessageBoxIcon.Question)
	ElseIf Icon = "Arrêter" Then
		MessageBox.Show(Message, Titre, MessageBoxButtons.OK, MessageBoxIcon.Stop)
	ElseIf Icon = "Avertissement" Then
		MessageBox.Show(Message, Titre, MessageBoxButtons.OK, MessageBoxIcon.Warning)
			Else
				MessageBox.Show("Essaye d'autres choses", "Ca existe pas")
	End If

 

0 Likes
1,230 Views
8 Replies
Replies (8)
Message 2 of 9

Michael.Navara
Advisor
Advisor

I'm not sure, what do you try to achieve. Function MessageBox.Show() has several combinations of possible parameters, Some of them are free text values, some are from pre-defined values (enums), some are complex objects (like HelpNavigator, IWin32Window,...).

 

Do you want some "code generator" for message box?

0 Likes
Message 3 of 9

mgrenier1
Collaborator
Collaborator

It's like a UI for building basic MessageBox instead of doing it with code everytime I need a new one. Like, you Input the Title, Message, then select an Icon(I should add buttons selection too) and it builds a messagebox from the inputs. I would like to save the output though, I'm just sure how to achieve to it.

0 Likes
Message 4 of 9

Michael.Navara
Advisor
Advisor

It is much easier to do it in Excel, but I'm not sure, if it is handy.

 

0 Likes
Message 5 of 9

mgrenier1
Collaborator
Collaborator

It didn't even cross my mind to do it like this, how would you bring the code snippet back in an iLogic rule though? 

0 Likes
Message 6 of 9

Michael.Navara
Advisor
Advisor
0 Likes
Message 7 of 9

mgrenier1
Collaborator
Collaborator

That would be one way to do it but I don't like it very much

0 Likes
Message 8 of 9

WCrihfield
Mentor
Mentor

Hi @mgrenier1.  Just checking, because it is difficult to judge sometimes, but are you familiar with the 'Wizard' built right into the iLogic Rule Editor dialog?  On the Wizards tab is a button named 'Message Box'.  If you click that, a small user interface dialog shows, allowing you to select from 3 drop-down lists for 'Icon', 'Buttons', and 'Default Button', and has regular text boxes for 'Title' and 'Message' areas.

WCrihfield_0-1711472106942.png

 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 9 of 9

mgrenier1
Collaborator
Collaborator

I did not know about this, I guess Autodesk already tought about this lol

0 Likes