Old 10th May 2005, 13:10   #1
The Cool Dude
Senior Member
 
The Cool Dude's Avatar
 
Join Date: Jul 2004
Location: hell
Posts: 343
Attribs Maker

OK, i've made an Attribs Maker if u find any bugs please report them. This one can't make windows menu items as yet but it will be soon but it allows u to have mulipage menu etc. One things i like is that if u dont want to complete it in one day u can save it in tcdam format(The Cool Dude's Attribs Maker) and continue later!
Attached Files
File Type: zip attribs maker.zip (16.3 KB, 384 views)

The Cool Dude - a bit too cool
The Windows 2000 skin
Attribs Maker
The Cool Dude is offline   Reply With Quote
Old 13th May 2005, 22:09   #2
krckoorascic
Senior Member
 
krckoorascic's Avatar
 
Join Date: May 2004
Location: Serbia
Posts: 351
Send a message via ICQ to krckoorascic Send a message via AIM to krckoorascic Send a message via Yahoo to krckoorascic
ok, first: remove MessageBox that appears on startup (lot of people, including me, hates NAG screens, if you want to put some credits do that in about window...),
second: when you click cancel in save dialog it's saves file! (to fix this check for E******mber = cdlCancel before saving file)
third: why the hell you are declaring ConfigItem as ConfigAttribute?? i mean, when you want to have separate submenu for e.g. Drawers and put some items in it, code will be:
code:

#ifndef included
#error This script can only be compiled as a #include
#endif

#ifndef __ATTRIBS_M
#define __ATTRIBS_M

#include <lib/config.mi>

#define OPTIONS_MENU "{1828D28F-78DD-4647-8532-EBA504B8FC04}"
#define CUSTOM_PAGE "{26E26319-AECA-4433-B8F1-F4A5BF2A9ED5}"
#define CUSTOM_PAGE_DRAWERS "{C338B30F-2A04-4b10-871F-4E9D52D62806}"

Function initAttribs();

Global ConfigAttribute attAnimateDrawers;
Global ConfigAttribute attSnapAdjust;

initAttributes()
{
ConfigItem custom_page = Config.newItem(getSkinName(), CUSTOM_PAGE);
ConfigItem custom_page_drawers = Config.newItem("Drawers", CUSTOM_PAGE_DRAWER);
ConfigItem custom_options_page = Config.getItem(OPTIONS_MENU);

ConfigAttribute submenuattrib = custom_options_page.newAttribute(getSkinName(), "");
submenuattrib.setData(CUSTOM_PAGE);
ConfigAttribute drawersubmenu = custom_page.newAttribute("Drawers", "");
drawersubmenu.setData(CUSTOM_PAGE_DRAWERS);

attAnimateDrawers = custom_page_drawers.newAttribute("Animate Drawers", "0");
attSnapAdjust = custom_page_drawers.newAttribute("Snapadjust Docked Windows", "0");
}

Global Boolean myChange;

#endif


but, this is what your tool generate:
code:

#ifndef included
#error This script can only be compiled as a #include
#endif

#ifndef __ATTRIBS_M
#define __ATTRIBS_M

#include <lib/config.mi>

#define OPTIONS_MENU "{1828D28F-78DD-4647-8532-EBA504B8FC04}"
#define CUSTOM_PAGE "{26E26319-AECA-4433-B8F1-F4A5BF2A9ED5}"
#define CUSTOM_PAGE_DRAWERS "{C338B30F-2A04-4b10-871F-4E9D52D62806}"

Function initAttribs();

Global ConfigAttribute drawers;
Global ConfigAttribute attAnimateDrawers;
Global ConfigAttribute attSnapAdjust;

initAttributes()
{
ConfigItem custom_page = Config.newItem(getSkinName(), CUSTOM_PAGE);
ConfigItem custom_page_drawers = Config.newItem("Drawers", CUSTOM_PAGE_DRAWER);
ConfigItem custom_options_page = Config.getItem(OPTIONS_MENU);

ConfigAttribute submenuattrib = custom_options_page.newAttribute(getSkinName(), "");
submenuattrib.setData(CUSTOM_PAGE);
ConfigAttribute drawersubmenu = custom_page.newAttribute("Drawers", "");
drawersubmenu.setData(CUSTOM_PAGE_DRAWERS);

drawers = custom_page_drawers.newAttribute("Drawers", "0");
attAnimateDrawers = custom_page_drawers.newAttribute("Animate Drawers", "0");
attSnapAdjust = custom_page_drawers.newAttribute("Snapadjust Docked Windows", "0");
}

Global Boolean myChange;

#endif



i hope you'll fix this soon...

cheers,
krcko


krckoorascic is offline   Reply With Quote
Old 14th May 2005, 09:15   #3
The Cool Dude
Senior Member
 
The Cool Dude's Avatar
 
Join Date: Jul 2004
Location: hell
Posts: 343
will do that. + thanks for the shell thing the next version(being made) will associate .tcdam files! it works! but since u spotted this wont publish it now but next time thanks a lot.

The Cool Dude - a bit too cool
The Windows 2000 skin
Attribs Maker
The Cool Dude is offline   Reply With Quote
Old 14th May 2005, 22:31   #4
krckoorascic
Senior Member
 
krckoorascic's Avatar
 
Join Date: May 2004
Location: Serbia
Posts: 351
Send a message via ICQ to krckoorascic Send a message via AIM to krckoorascic Send a message via Yahoo to krckoorascic
np


krckoorascic is offline   Reply With Quote
Old 15th May 2005, 18:57   #5
krckoorascic
Senior Member
 
krckoorascic's Avatar
 
Join Date: May 2004
Location: Serbia
Posts: 351
Send a message via ICQ to krckoorascic Send a message via AIM to krckoorascic Send a message via Yahoo to krckoorascic
one more thing:
it seems that your tool can't generate separators?!?
if you noticed in my Menu Maker when you set - as a caption it generates code for separator...


krckoorascic is offline   Reply With Quote
Old 16th May 2005, 04:48   #6
The Cool Dude
Senior Member
 
The Cool Dude's Avatar
 
Join Date: Jul 2004
Location: hell
Posts: 343
Update

OK heres the latest update it associates .tcdam files with the Attribs Maker. It doesnt create a ConfigAttribute instead of a ConfigItem. krckoorascic, thanks for that i'll do that too. If anyone suggestions, bug reports, etc then post it here. After all this is for you.
Attached Files
File Type: zip tcdam.zip (32.7 KB, 397 views)

The Cool Dude - a bit too cool
The Windows 2000 skin
Attribs Maker
The Cool Dude is offline   Reply With Quote
Old 19th May 2005, 11:02   #7
The Cool Dude
Senior Member
 
The Cool Dude's Avatar
 
Join Date: Jul 2004
Location: hell
Posts: 343
Update

Now makes seperators too. just put "-" in the Caption and it will generate the code for that.

krckoorascic, 1 more thing - how did you make the test menu? i know u make a menu with visible unchecked and then make sub menu(arrays) then what do you do? thanks
Attached Files
File Type: zip tcdam.zip (33.1 KB, 357 views)

The Cool Dude - a bit too cool
The Windows 2000 skin
Attribs Maker
The Cool Dude is offline   Reply With Quote
Old 20th May 2005, 23:58   #8
krckoorascic
Senior Member
 
krckoorascic's Avatar
 
Join Date: May 2004
Location: Serbia
Posts: 351
Send a message via ICQ to krckoorascic Send a message via AIM to krckoorascic Send a message via Yahoo to krckoorascic
very good job!

about test menu:
i didn't used that metod (to lame ) i used api
these are functions i used for generating menu:
code:

Declare Function CreatePopupMenu Lib "user32" () As Long
Declare Function TrackPopupMenuEx Lib "user32" (ByVal hMenu As Long, ByVal wFlags As Long, ByVal X As Long, ByVal Y As Long, ByVal HWnd As Long, ByVal lptpm As Any) As Long
Declare Function AppendMenu Lib "user32" Alias "AppendMenuA" (ByVal hMenu As Long, ByVal wFlags As Long, ByVal wIDNewItem As Long, ByVal lpNewItem As Any) As Long
Declare Function DestroyMenu Lib "user32" (ByVal hMenu As Long) As Long
Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long


download API-Guide from www.allapi.net if you're not fimiliar with these api's

and this is code which generates menu:
code:

Public Sub runTest()
On Error Resume Next

Dim Pt As POINTAPI
Dim ret As Long
Dim i As Long
Dim k As Long
Dim l As Long
Dim hMenu As Long
Dim sMenu As Long

hMenu = CreatePopupMenu()

i = UBound(MenuItem)

If E******mber = 9 Then
AppendMenu hMenu, MF_STRING Or MF_GRAYED, 1, "No Option For This Skin"
Else
For i = LBound(MenuItem) To UBound(MenuItem)
If MenuItem(i).smType = ConfigAttribute Then
If MenuItem(i).smCaption = "-" Then
AppendMenu hMenu, MF_SEPARATOR, i, ByVal 0&
Else
AppendMenu hMenu, MF_STRING, i, MenuItem(i).smCaption
End If
Else
sMenu = CreatePopupMenu
l = i
For k = i + 1 To UBound(MenuItem)
If Left$(frmMain.lstMenu.List(k), 4) <> Separator Then
i = k - 1
Exit For
End If
If MenuItem(k).smCaption = "-" Then
AppendMenu sMenu, MF_SEPARATOR, i, ByVal 0&
Else
AppendMenu sMenu, MF_STRING, i, MenuItem(k).smCaption
End If
Next
AppendMenu hMenu, MF_STRING Or MF_POPUP, sMenu, MenuItem(l).smCaption
If k - 1 = UBound(MenuItem) Then Exit For
End If
Next
End If

GetCursorPos Pt
ret = TrackPopupMenuEx(hMenu, TPM_BOTTOMALIGN Or TPM_RETURNCMD Or TPM_RIGHTBUTTON, Pt.X, Pt.Y, frmMain.HWnd, ByVal 0&)
DestroyMenu hMenu
DestroyMenu sMenu
End Sub


hope, this helped

cheers,
krcko


krckoorascic is offline   Reply With Quote
Old 21st May 2005, 08:28   #9
The Cool Dude
Senior Member
 
The Cool Dude's Avatar
 
Join Date: Jul 2004
Location: hell
Posts: 343
have saved it will tell u about the test menu once i try that out. thnks a lot.

The Cool Dude - a bit too cool
The Windows 2000 skin
Attribs Maker
The Cool Dude is offline   Reply With Quote
Old 22nd May 2005, 12:55   #10
The Cool Dude
Senior Member
 
The Cool Dude's Avatar
 
Join Date: Jul 2004
Location: hell
Posts: 343
sorry not that great @ vb pls explain each api 4 me.

The Cool Dude - a bit too cool
The Windows 2000 skin
Attribs Maker
The Cool Dude is offline   Reply With Quote
Old 22nd May 2005, 22:43   #11
krckoorascic
Senior Member
 
krckoorascic's Avatar
 
Join Date: May 2004
Location: Serbia
Posts: 351
Send a message via ICQ to krckoorascic Send a message via AIM to krckoorascic Send a message via Yahoo to krckoorascic
:D
ok,

Declare Function CreatePopupMenu Lib "user32" () As Long

this one creates a popup menu ;)
use it like this:
code:

Dim myMenu As Long

myMenu = CreatePopupMenu()


now myMenu holds handle of new menu, but before you show it you have to add something to it ;D

Declare Function AppendMenu Lib "user32" Alias "AppendMenuA" (ByVal hMenu As Long, ByVal wFlags As Long, ByVal wIDNewItem As Long, ByVal lpNewItem As Any) As Long

with this api you add items to your menu:
code:

AppendMenu myMenu, MF_STRING, 0, "Some text"


myMenu is handle of menu on which you're adding item, MF_STRING is a constant, here are some constants you'll maybe need:
code:

Const MF_CHECKED As Long = &H8&
Const MF_APPEND As Long = &H100&
Const MF_DISABLED As Long = &H2&
Const MF_GRAYED As Long = &H1&
Const MF_SEPARATOR As Long = &H800&
Const MF_STRING As Long = &H0&
Const MF_POPUP As Long = &H10&


0 is a value which will be returned when is clicked on that menu item (in this case you may put all zeros, cuz you only want to show menu)

and "Some text" is a text that will be shown in menu ;)

to add separator use this code:
code:

AppendMenu myMenu, MF_SEPARATOR, i, ByVal 0&


just simple as that :D



Declare Function TrackPopupMenuEx Lib "user32" (ByVal hMenu As Long, ByVal wFlags As Long, ByVal X As Long, ByVal Y As Long, ByVal HWnd As Long, ByVal lptpm As Any) As Long

this api shows your menu, use this code
code:

ret = TrackPopupMenuEx(myMenu, TPM_BOTTOMALIGN Or TPM_RETURNCMD Or TPM_RIGHTBUTTON, Pt.X, Pt.Y, frmMain.HWnd, ByVal 0&)


for that you'll need these constants:
code:

Const TPM_LEFTALIGN As Long = &H0&
Const TPM_BOTTOMALIGN As Long = &H20&
Const TPM_RETURNCMD As Long = &H100&
Const TPM_RIGHTBUTTON As Long = &H2&



myMenu is a handle of menu you want to show

TPM_BOTTOMALIGN Or TPM_RETURNCMD Or TPM_RIGHTBUTTON are some flags (you may leave them alone)

Pt.X and Pt.Y are x and y positions on screen where you want your menu to popup (i used here POINTAPI structure, you'll see below)

frmMain.HWnd is a hande of a window on which you want to show this menu :p


Declare Function DestroyMenu Lib "user32" (ByVal hMenu As Long) As Long

with this you delete menu from memory (you MUST do this)
use like this:
code:

DestroyMenu myMenu




Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long

this one returns cursor position on screen in POINTAPI strutcure:
code:

Private Type POINTAPI
X As Long
Y As Long
End Type




this is how you add submenus:
first create whole submenu (use CreatePopupMenu and AppendMenu, just like i sad above) and then add it (that submenu) to your "parent" menu like this:
code:

AppendMenu myMenu, MF_STRING Or MF_POPUP, subMenu, "Submenu text"



myMenu is a handle of parent menu

MF_STRING Or MF_POPUP defines this like submenu

subMenu is a handle of menu you want to add as submenu

and "Submenu text"... you now what is it :D

hope this helped...

p.s. have you downloaded API-Guide? you have this explained much more better in it :D


krckoorascic is offline   Reply With Quote
Old 23rd May 2005, 05:29   #12
The Cool Dude
Senior Member
 
The Cool Dude's Avatar
 
Join Date: Jul 2004
Location: hell
Posts: 343
thanks a lot i'm sure this will help!

The Cool Dude - a bit too cool
The Windows 2000 skin
Attribs Maker
The Cool Dude is offline   Reply With Quote
Old 24th May 2005, 10:09   #13
The Cool Dude
Senior Member
 
The Cool Dude's Avatar
 
Join Date: Jul 2004
Location: hell
Posts: 343
Update

Now it has a test menu and one more bug fixed: when u move(up or down) a attrib only the caption moved not the name so the caption had the name of the attrib that was there before it so all the names went wierd. now that doesnt happen.
Attached Files
File Type: zip tcdam.zip (34.8 KB, 385 views)

The Cool Dude - a bit too cool
The Windows 2000 skin
Attribs Maker
The Cool Dude is offline   Reply With Quote
Old 28th May 2005, 14:36   #14
krckoorascic
Senior Member
 
krckoorascic's Avatar
 
Join Date: May 2004
Location: Serbia
Posts: 351
Send a message via ICQ to krckoorascic Send a message via AIM to krckoorascic Send a message via Yahoo to krckoorascic
excelent!
but, one more thing you should fix
i noticed that your shell command "Open With Attrims Maker" is not a default action for .tcdam files (my bad, i give you a code that only adds items to context menu), to make your action be a default, use something like this (using my reg class i sent you):
code:

Public Sub doShell()
Dim Registry As New clsRegistryAccess
Registry.WriteString "HKCR\.tcdam", "@", "TCDAttribsMaker"
Registry.WriteString "HKCR\TCDAttribsMaker", "@", "The Cool Dude's Attribs Maker File"
Registry.WriteString "HKCR\TCDAttribsMaker\DefaultIcon", App.Path & "\" & App.EXEName & ".exe,0"
Registry.WriteString "HKCR\TCDAttribsMaker\shell\open", "@", "&Open With Attribs Maker"
Registry.WriteString "HKCR\TCDAttribsMaker\shell\open\command", "@", Chr$(34) & App.Path & "\" & App.EXEName & ".exe" & Chr$(34) & " " & Chr$(34) & "%1" & Chr$(34)

End Sub



krckoorascic is offline   Reply With Quote
Old 3rd June 2005, 14:41   #15
The Cool Dude
Senior Member
 
The Cool Dude's Avatar
 
Join Date: Jul 2004
Location: hell
Posts: 343
thanks i just realized that when my tcdam file opened with another app.

The Cool Dude - a bit too cool
The Windows 2000 skin
Attribs Maker
The Cool Dude is offline   Reply With Quote
Old 5th June 2005, 14:26   #16
The Cool Dude
Senior Member
 
The Cool Dude's Avatar
 
Join Date: Jul 2004
Location: hell
Posts: 343
Update

OK fixxed that. Heres the update. can other users give reviews too? cause krckoorascic gives me all the coding probs if someone dowsnt like something else then i can fix that too.
Attached Files
File Type: zip attribs.zip (34.2 KB, 386 views)

The Cool Dude - a bit too cool
The Windows 2000 skin
Attribs Maker
The Cool Dude is offline   Reply With Quote
Old 20th June 2005, 07:23   #17
corwwin
Senior Member
 
corwwin's Avatar
 
Join Date: Mar 2002
Location: Kingdom of Amber
Posts: 275
Seems to be useful.... But how do you use it?
corwwin is offline   Reply With Quote
Old 20th June 2005, 23:46   #18
krckoorascic
Senior Member
 
krckoorascic's Avatar
 
Join Date: May 2004
Location: Serbia
Posts: 351
Send a message via ICQ to krckoorascic Send a message via AIM to krckoorascic Send a message via Yahoo to krckoorascic
yeah, tcd you should write some help

and one more bug cought
when you click on about you got a file not found error
how to fix:
don't use LoadPicture on frmAbout_Load load picture in picture box in design-time (or load it from resource)


krckoorascic is offline   Reply With Quote
Old 24th June 2005, 10:28   #19
The Cool Dude
Senior Member
 
The Cool Dude's Avatar
 
Join Date: Jul 2004
Location: hell
Posts: 343
will make. thanks!

The Cool Dude - a bit too cool
The Windows 2000 skin
Attribs Maker
The Cool Dude is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Skinning and Design > Modern Skins

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump