July 13, 2024, 07:33:09 PM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


i need help with trackbar

Started by ExMember001, January 15, 2007, 12:53:02 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ExMember001

January 15, 2007, 12:53:02 PM Last Edit: January 15, 2007, 04:07:44 PM by KrYpT
I cant seems to make the first trackbar from the left of the dialog to works
i use this method in my other main window an it works there

what should i do to get the message box from the UpdateFXEQ method to showup?


import Unsigned INT GetSysColor(INT nIndex);

/////////////////////////////////////////////////////////////////
// Equalizer Dialog Class Definitions and Methods
/////////////////////////////////////////////////////////////////

//Equalizer Control ID
enum EQ_ControlID
{
EqClose = 501,
k125,
S125,
k1,
S1,
k8,
S8,
Reverb,
SReverb
}

class Equalizer:CDialog
{
declare virtual OnInitDialog(),int;
declare virtual OnClose(),int;
declare virtual OnControl(int nID, int nNotifyCode, unsigned int hControl),int;
declare virtual OnHScroll(int nCommand,int nPos,int nID),int;

declare OpenDLG(CWINDOW *Parent);
declare UpdateFXEQ(int FxID, int Pos);

//AMpKC *Player;

CTRACKBAR *T125,*T1,*T8,*TReverb;
CSTATIC *St125,*St1,*St8,*StReverb;
}

Equalizer::OpenDLG(CWINDOW *Parent)
{
//Player = *Parent;
Create(0,0,367,179,0x80CA0080,0,"AmpKC - Equalizer",0);
AddControl(CTBUTTON,"Close",148,149,70,20,0x5000000B,0x0,EqClose);
AddControl(CTTRACKBAR,"",30,22,40,100,AWS_VISIBLE|ATBS_AUTOTICKS|ATBS_VERT|ATBS_BOTH,0x0,k125);
AddControl(CTTRACKBAR,"",90,22,40,100,AWS_VISIBLE|ATBS_AUTOTICKS|ATBS_VERT|ATBS_BOTH,0x0,k1);
AddControl(CTTRACKBAR,"",150,22,40,100,AWS_VISIBLE|ATBS_AUTOTICKS|ATBS_VERT|ATBS_BOTH,0x0,k8);
AddControl(CTTRACKBAR,"",305,22,40,100,AWS_VISIBLE|ATBS_AUTOTICKS|ATBS_VERT|ATBS_BOTH,0x0,Reverb);
AddControl(CTSTATIC,"125 KhZ",29,125,50,20,AWS_VISIBLE,0x0,S125);
AddControl(CTSTATIC,"1 KhZ",94,125,40,20,AWS_VISIBLE,0x0,S1);
AddControl(CTSTATIC,"8 KhZ",154,125,40,20,AWS_VISIBLE,0x0,S8);
AddControl(CTSTATIC,"Reverb",307,125,40,20,AWS_VISIBLE,0x0,SReverb);

domodal();
return;
}

Equalizer::OnClose(),int
{
CloseDialog(1);
//Player->isEqualizerOpen = False;
return true;
}

Equalizer::OnInitDialog(),int
{
/* Initialize any controls here */
CenterWindow();

//setup trackbars
T125 = GetControl(k125);
T125->SetColor(GetSysColor(15),GetSysColor(15));
T125->SetRange(0, 20);
T125->SetPos(20);
T1 = GetControl(k1);
T1->SetColor(GetSysColor(15),GetSysColor(15));
T1->SetRange(0, 20);
T1->SetPos(20);
T8 = GetControl(k8);
T8->SetColor(GetSysColor(15),GetSysColor(15));
T8->SetRange(0, 20);
T8->SetPos(20);
TReverb = GetControl(Reverb);
TReverb->SetColor(GetSysColor(15),GetSysColor(15));
TReverb->SetRange(0, 20);
TReverb->SetPos(20);

//setup static controls
St125 = GetControl(S125);
St1 = GetControl(S1);
St8 = GetControl(S8);
StReverb = GetControl(SReverb);

return true;
}

Equalizer::OnControl(int nID, int nNotifyCode, unsigned int hControl),int
{
select nID
{
case EqClose:
if(nNotifyCode = 0)
{
/*button clicked*/
OnClose();
}
}
return true;
}

Equalizer::OnHScroll(int nCommand,int nPos,int nID),int
{
Select nID
{
case k125:
    int pos = T125->GetPos();
    select nCommand
{
case TBTHUMBTRACK:
UpdateFXEQ(0,pos);

case TBPAGEUP:
    UpdateFXEQ(0,pos);

case TBPAGEDOWN:
    UpdateFXEQ(0,pos);

case TBLINEUP:
    UpdateFXEQ(0,pos);

    case TBLINEDOWN:
    UpdateFXEQ(0,pos);
}
}
return;
}

Equalizer::UpdateFXEQ(int FxID, int Pos)
{
messagebox(this, numtostr(pos), "");
//BASS_FXGetParameters(Player->fx[FxNum],&Player->FXP);
//Player->FXP.fGain=10.0+pos;
//BASS_FXSetParameters(Player->fx[FxNum],&Player->FXP);
return;
}

global sub main()
{
Equalizer equa;
equa.OpenDLG(0);
return false;
}

Ionic Wind Support Team

Override OnVScroll instead of OnHScroll.  All of your trackbars are vertical, not horizontal.
Ionic Wind Support Team

ExMember001