Results 1 to 8 of 8
  1. #1
    oyasuna.dev's Avatar
    Join Date
    Jun 2011
    Gender
    male
    Location
    United States.
    Posts
    32
    Reputation
    10
    Thanks
    374

    Tabs (idea from ac1d_buRn's "XL Tabs")

    EDIT 2: CREDITS TO TOPBLAST! HE GAVE AC1D_BURN THE SOURCE AND HE RELEASED IT!

    EDIT: WARNING THIS WAS BUILT FOR 800 WINDOW WIDTH! I DIDN'T REALIZE THAT PROBLEM TO KNOW, WHEN I TESTED IN 1600! BUT ANY REAL CODER CAN FIGURE OUT THE PROBLEM!

    Hello everyone! Welcome to another source code release by me!

    So I was looking around MPGH, and within the Combat Arms Hack Source I found a thread started by ac1d_buRn. The code includes a method of creating "XL Tabs," as ac1d_buRn would say in his original thread.

    What I did was took the idea and made a simpler and more organized version! So here it is!


    My Class
    Code:
    class Tabs
    {
    public:
    	int inumberTabs;
    	int tabSize;
    	int currentItem;
    	char *arrayText[6]; //6 is the number of tabs
    	void InitiateTabs(double screenWidth, int numberTabs);
    	void AddTab(int number, int arrayNum);
    	void NavigateTabs();
    }
    Initiate Tabs
    Code:
    void Tabs::InitiateTabs(double screenWidth, int numberTabs)
    {
    	arrayText[0] = "Tab 1"; //Tab 1 text
    	arrayText[1] = "Tab 2"; //Tab 2 text
    	arrayText[2] = "Tab 3"; //Tab 3 text
    	arrayText[3] = "Tab 4"; //Tab 4 text
    	arrayText[4] = "Tab 5"; //Tab 5 text
    	arrayText[5] = "Tab 6"; //Tab 6 text
    
    	inumberTabs = numberTabs; //Set inumberTabs to numberTabs so that we can use the value of numberTabs outside the function
    
    	tabSize = screenWidth / numberTabs; //Set the tab size to a numberTabs'th of the screen(/window in my case) width
    }
    Add Tab
    Code:
    void Tabs::AddTab(int number, int arrayNum)
    {
    	DrawBox1((tabSize * (number - 1)) + 1, 0, tabSize + 1, 50, 3, D3DCOLOR_ARGB(255, 192, 192, 192), D3DCOLOR_XRGB(100, 100, 100), g_pLine);
    
    	PrintText2((tabSize * (number - 1)) - tabSize * 1.4f, 0, D3DCOLOR_XRGB(255, 0, 0), DT_CENTER | DT_VCENTER, g_pFont, arrayText[arrayNum]);
    }
    Navigation
    Code:
    void Tabs::NavigateTabs()
    {
    	if(GetAsyncKeyState(VK_RIGHT)&1)
    	{
    		if(currentItem < inumberTabs - 1)
    		{
    			currentItem++;
    		}
    	}
    	if(GetAsyncKeyState(VK_LEFT)&1)
    	{
    		if(currentItem > 0)
    		{
    			currentItem--;
    		}
    	}
    
    	DrawBox1(tabSize * currentItem, 0, tabSize + 1, 50, 3, D3DCOLOR_ARGB(255, 131, 181, 131), NULL, g_pLine);
    	DrawBorder1((tabSize * currentItem) + 2, 0 + 2, tabSize + 1 - 4, 50 - 4, 1, D3DCOLOR_ARGB(255, 80, 130, 80), g_pLine);
    	DrawBorder1(tabSize * currentItem, 0, tabSize + 1, 50, 2, D3DCOLOR_ARGB(255, 0, 255, 0), g_pLine);
    
    	PrintText2((tabSize * currentItem) - tabSize * 1.4f, 0, D3DCOLOR_XRGB(255, 0, 0), DT_CENTER | DT_VCENTER, g_pFont, arrayText[currentItem]);
    }
    Okay that's all the functions!

    My functions:
    Code:
    FillARGB1(double x, double y, double w, double h, DWORD dwColor, LPD3DXLINE pLine);
    DrawBorder1(double x, double y, double w, double h, int px, DWORD dwColor, LPD3DXLINE pDevice);
    DrawBox1(double x, double y, double w, double h, int px, DWORD dwFillColor, DWORD dwBorderColor, LPD3DXLINE pLine);
    PrintText2(double x, double y, DWORD dwColor, DWORD dwFormat, LPD3DXFONT pFont, char *Text, ...);
    Last edited by oyasuna.dev; 06-24-2011 at 11:36 AM.

  2. #2
    topblast's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Location
    Far from around you Programmer: C++ | VB | C# | JAVA
    Posts
    3,607
    Reputation
    149
    Thanks
    5,052
    My Mood
    Cool
    I made the first Tabs hack in the CA section :O, all others are copy cats
    I just like programming, that is all.

    Current Stuff:

    • GPU Programmer (Cuda)
    • Client/Server (Cloud Server)
    • Mobile App Development

  3. #3
    oyasuna.dev's Avatar
    Join Date
    Jun 2011
    Gender
    male
    Location
    United States.
    Posts
    32
    Reputation
    10
    Thanks
    374
    Quote Originally Posted by topblast View Post
    I made the first Tabs hack in the CA section :O, all others are copy cats
    okay... sorry about that. Edited thread!

    and do you like my thread?
    Last edited by oyasuna.dev; 06-24-2011 at 11:37 AM.

  4. #4
    ♪~ ᕕ(ᐛ)ᕗ's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    Uterus
    Posts
    9,119
    Reputation
    1096
    Thanks
    1,970
    My Mood
    Doh
    really nice, keep it up dude.

  5. #5
    topblast's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Location
    Far from around you Programmer: C++ | VB | C# | JAVA
    Posts
    3,607
    Reputation
    149
    Thanks
    5,052
    My Mood
    Cool
    i didnt give him the source. I just made the first Tab Menu and everyone steal my idea.
    I just like programming, that is all.

    Current Stuff:

    • GPU Programmer (Cuda)
    • Client/Server (Cloud Server)
    • Mobile App Development

  6. #6
    l4152630's Avatar
    Join Date
    May 2011
    Gender
    male
    Posts
    19
    Reputation
    10
    Thanks
    1
    What is the function of the code?

  7. #7
    whit++++'s Avatar
    Join Date
    Jun 2011
    Gender
    female
    Posts
    56
    Reputation
    22
    Thanks
    10
    Quote Originally Posted by topblast View Post
    I made the first Tabs hack in the CA section :O, all others are copy cats
    Tabs have been around for awhile

  8. The Following User Says Thank You to whit++++ For This Useful Post:

    ac1d_buRn (12-20-2011)

  9. #8
    topblast's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Location
    Far from around you Programmer: C++ | VB | C# | JAVA
    Posts
    3,607
    Reputation
    149
    Thanks
    5,052
    My Mood
    Cool
    Quote Originally Posted by whit++++ View Post
    Tabs have been around for awhile
    On this site In the CA sectopm, Before I posted a hack with them?

    PUBLICLY!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    *SUPER FREAKY*!
    I just like programming, that is all.

    Current Stuff:

    • GPU Programmer (Cuda)
    • Client/Server (Cloud Server)
    • Mobile App Development