IPB

Welcome Guest ( Log In | Register )

How to make WSH panel rollover button?
hanulbi
post Mar 27 2010, 14:51
Post #1





Group: Members
Posts: 2
Joined: 28-February 10
Member No.: 78583



I am making columnsUI skin, but I have a problem.
How to make WSH panel rollover menu button?

here is my code. please help me....

sorry for my poor english...

CODE
function RGB(r,g,b,a){ return ((a<<24)|(r<<16)|(g<<8)|(b)); }
var imgh = gdi.image(fb.FoobarPath+"Skins\\shootke\\btn-menuh.png");
var img = gdi.image(fb.FoobarPath+"Skins\\shootke\\btn-menu.png");

function on_paint(gr){
    gr.SetInterpolationMode(7);
    gr.DrawImage(img,0,0,83,55,0,0,83,55);
    }
window.Repaint();

function on_mouse_move(x,y) {
}
function on_mouse_leave() {
}

var MF_SEPARATOR = 0x00000800;
var MF_ENABLED = 0x00000000;
var MF_GRAYED = 0x00000001;
var MF_DISABLED = 0x00000002;
var MF_UNCHECKED = 0x00000000;
var MF_CHECKED = 0x00000008;
var MF_STRING = 0x00000000;
var MF_POPUP = 0x00000010;
var MF_RIGHTJUSTIFY = 0x00004000;

function on_mouse_lbtn_up(x, y) {

    var basemenu = window.CreatePopupMenu();
    var contextman = fb.CreateContextMenuManager();
    
    contextman.InitNowPlaying();

    var child1 = window.CreatePopupMenu(); //File
    var child2 = window.CreatePopupMenu(); //Edit
    var child3 = window.CreatePopupMenu(); //View
    var child4 = window.CreatePopupMenu(); //Playback
    var child5 = window.CreatePopupMenu(); //Library
    var child6 = window.CreatePopupMenu(); //Help
    var child7 = window.CreatePopupMenu(); //Now playing
    
    var menuman1 = fb.CreateMainMenuManager();
    var menuman2 = fb.CreateMainMenuManager();
    var menuman3 = fb.CreateMainMenuManager();
    var menuman4 = fb.CreateMainMenuManager();
    var menuman5 = fb.CreateMainMenuManager();
    var menuman6 = fb.CreateMainMenuManager();

    basemenu.AppendMenuItem(MF_STRING | MF_POPUP, child1.ID, "File");
    basemenu.AppendMenuItem(MF_STRING | MF_POPUP, child2.ID, "Edit");
    basemenu.AppendMenuItem(MF_STRING | MF_POPUP, child3.ID, "View");
    basemenu.AppendMenuItem(MF_STRING | MF_POPUP, child4.ID, "Playback");
    basemenu.AppendMenuItem(MF_STRING | MF_POPUP, child5.ID, "Library");
    basemenu.AppendMenuItem(MF_STRING | MF_POPUP, child6.ID, "Help");
    basemenu.AppendMenuItem(MF_STRING | MF_POPUP, child7.ID, "Now Playing");

    menuman1.Init("file");
    menuman2.Init("edit");
    menuman3.Init("View");
    menuman4.Init("playback");
    menuman5.Init("library");
    menuman6.Init("help");

    menuman1.BuildMenu(child1, 1, 200);
    menuman2.BuildMenu(child2, 201, 200);
    menuman3.BuildMenu(child3, 401, 200);
    menuman4.BuildMenu(child4, 601, 300);
    menuman5.BuildMenu(child5, 901, 300);
    menuman6.BuildMenu(child6, 1201, 100);

    contextman.InitNowPlaying();
    contextman.BuildMenu(child7, 1301, -1);
    ret = 0;

    ret = basemenu.TrackPopupMenu(x, y);

    // fb.trace(ret);
    switch (true)
    {
    case (ret >= 1 && ret < 201):
        menuman1.ExecuteByID(ret - 1);
        break;

    case (ret >= 201 && ret < 401):
        menuman2.ExecuteByID(ret - 201);
        break;

    case (ret >= 401 && ret < 601):
        menuman3.ExecuteByID(ret - 401);
        break;
    
    case (ret >= 601 && ret < 901):
        menuman4.ExecuteByID(ret - 601);
        break;
    
    case (ret >= 901 && ret < 1201):
        menuman5.ExecuteByID(ret - 901);
        break;
    
    case (ret >= 1201 && ret < 1301):
        menuman6.ExecuteByID(ret - 1201);
        break;
    
    case (ret >= 1301):
        contextman.ExecuteByID(ret - 1301);
        break;
    }

    basemenu.Dispose();
    contextman.Dispose();
    menuman1.Dispose();
    menuman2.Dispose();
    menuman3.Dispose();
    menuman4.Dispose();
    menuman5.Dispose();
    menuman6.Dispose();
}
Go to the top of the page
+Quote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 21st April 2014 - 00:33