Layout Designer

Hi there people! I have been playing around with mAirlist for a while now (and it is brillaint I have to say!).

I have been trying alot of skin/layout arrangements to try and get it to what I want. I’m still not there.

What takes the time with the layouts is deciding on the numbers. This is where the layout designer comes in. I have made a very simple app that allows be to draw boxes on my screen, and when i double click on it, it tells me the numbers to put in to the layout file.

Ideally I want to be able to do everything with this application, and it will automatically save it into the layout/skin files. I have made my app in VB and well…if anyone out there knows VB and wants to give me a hand - let me know! (Ideally we need to make VB Controls that replicate mAirList ones, things like playlist, players and browser.)

When its done - one shall release it into the free mAirList community!

Thanks,

Matt

Hi Matt

I have made a very simple app that allows be to draw boxes on my screen, and when i double click on it, it tells me the numbers to put in to the layout file.
Sounds great! I think this would be the right app for me since calculating and configuring positions of windows seems to be a very complicated job to do.

Imho this would encourage more user to modify the mAirList layout.
Unfortunately I don’t have the know-how to support you, but please let me know when your app is ready for beta testing. My supporting comments may be the only thing I can do for you.

Thanks
Uli

Matt, you’ve obviously been working on something which I’ve thought for a long time is the ‘missing piece of the jigsaw’ that would make mAirList more-or-less perfect.

As it happens, I’ve written a lot of VB6 apps. professionally (including controls!), and would love to help with this, but:

  1. I don’t have an installed copy of VB6.
  2. I think I’ll be doing quite a bit of Wiki work first. (!)

What I could do is get involved offline to help you get from alpha to beta stage by alpha-testing the app. and suggesting changes/improvements/helping with any coding problems. I think this would need to be done offline from the Forum to begin with (they can be—rightly!—a very critical lot in here! :wink: ). You could then—with Torben’s approval—beta test it with the help of the fine folk in this Forum.

If that’s of interest to you, please pm me with your e-mail address and we can take it from there.

BFN
CAD

Matt, please add me to the beta test list.

Kind regards Tony

Matt,
Sounds like you just need a bit of sample INI read/write code… I’ll have a dig around and PM you something that will do this. You can then modify it to include the correct mAirList layout/skin headings and take it from there.

Cheers for the responses guys!

I shall let you all know when it gets to alpha level.

Sounds like you just need a bit of sample INI read/write code... I'll have a dig around and PM you something that will do this. You can then modify it to include the correct mAirList layout/skin headings and take it from there.

Thanks charlie - that will be great.

Thanks again,

Matt

Matt,
For yours and Cad’s benefit - a public post with some VB code:

Assuming you have some text boxes with your shape values, here’s how to read a value (defaulting to Left=5 if not found):

Dim ini_file As String ini_file = "layout.ini" Dim buf As String * 256 Dim length As Long length = GetPrivateProfileString( _ "Browser", "Left", "5", _ buf, Len(buf), "layout.ini") BrowserLeft.Text = Left$(buf, length)

…and here’s how to write a value:

WritePrivateProfileString _ "Browser", "Left", _ BrowserLeft.Text, "layout.ini"

Remember to put this at the top of each form - there’s 3 lines there, but they truncate due to to the forum width :slight_smile:

[code]Private Declare Function GetPrivateProfileString Lib “kernel32” Alias “GetPrivateProfileStringA” (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long

Private Declare Function GetPrivateProfileInt Lib “kernel32” Alias “GetPrivateProfileIntA” (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal nDefault As Long, ByVal lpFileName As String) As Long

Private Declare Function WritePrivateProfileString Lib “kernel32” Alias “WritePrivateProfileStringA” (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal lpString As String, ByVal lpFileName As String) As Long
[/code]

This code is taken from one of my applications, and the INI file (using this method) is read/written from the Windows folder, so you’ll have to add your own code/config-option so that it places/obtains the INI files from the mAirList folder - Perhaps “App.Path” if the tool is placed in the main folder ?

I’m in the studio, so didn’t use VB to get this - Just opened it up on Notepad, but that’s the basis of INI file reading/writing.

I used to use an INIfile object what we wrote, with Methods like OpenINIFile, GetValue(section, key, value, VBtype, default), etc.

But yes, what you’ve got there is correct, and one does not need to go as far as writing a custom object (though that can make the code neater).

It’s extremely useful to define a ‘default’ parameter on the function which reads a key value, the value of ‘default’ being returned as the function value when the key doesn’t exist. :slight_smile:

BFN
CAD

Hi guys - thanks for the info!

I am currently working on getting the program to read the mairlist.ini file and enable/disable control appropriatly (i.e. LEDClock and stuff) just a quick question! Do both the toolbar and browser always have to be there?

Also - for the cartwall, what value tells me that it opens in a new window?

Cheers,

Matt

[Cartwall] Enabled=on OwnWindow=off (or on)

To look for other options, open the mairlist.ini in Notepad, then do CTRL-F to find text.

Cheers Charlie thats great. How about the toolbar and browser? Am i right in thinking they dont have an on/off and that they should always be used?

Cheers,

Matt

Yes. Although you might set their width and height to 0 in order to hide them. But there’s no on/off switch.

Torben

puzzled?<

Correct me if I’m wrong, Torben, but I thought that any section not present in a position.ini file is not visible? In fact, I’m certain that someone mentioned in another post that they did just this to ‘switch off’ the main Toolbar?

So, to Matt: if you have a position.ini file in your mAirList program folder, open it and manually delete the [Toolbar] and [Browser] sections if you are sure you don’t want them displayed.

If you don’t have a position.ini file, all I can suggest is that you read about it in the Wiki and ask again here if it doesn’t make sense; but most users do create a position.ini for their custom layout.

BFN
CAD

Cad. you’re probably talking of layout.ini and not position.ini (the latter is the file used when mAirList is configured to remember its last position).

Furtheron, you do have to specify values for all screen elements, even for those you don’t want to be displayed (browser and/or toolbar). Otherwise, they will be displayed at an arbitrary position.

Torben

Thanks for clearing that up Torben!

Just a quick thing - the Toolbar cannot be hidden with just setting width and height to 0. I had to use the skin.ini to turn off the buttons and that got rid of it.

Just so you know!

Cheers,

Matt

Hm, strange. Perhaps because of the AutoSize setting, which makes the toolbar adapt its size to the total size of the buttons. So you either have to hide all buttons, or you turn of AutoSize. Just a guess. (No Windows here at the moment.)

Anyway, it’s not a big deal to introduce a “Visible=off” setting for layout.ini, which would be is a little more straightforward way to hide that stuff :wink:

Torben

Adding a means of hiding the toolbar in the config utility would be a bonus Torben, we currently hide it as you suggest by moving the other screen elements and positioning them above it.

In our case the players.

Kind regards Tony

I assume, then, that if the Toolbar is visible (ie: enabled) the default shortcut keys will still call the various functions (Open, Save etc)… Not ideal if you’re trying to stop things like that.

A nice layout tip which I’ve just discovered - If you have a Browser or 2nd Playlist on the right-side of your screen, but want a static CartWall - just place the CartWall over the top, and enable the Tool button for it in the CartWall settings - You then have a a view that swaps between the CartWall, and whatever is under it.

Oh.

When did the [Toolbar] section move to skin.ini?!! I thought it was still a section in mairlist.ini?

BFN
CAD