Merged "wxWidgets VS template for windows" from juryben

That big 40MB file is useless so I merged the repos in a way that it
dissapears forever from the main repo.
This commit is contained in:
irungentoo 2013-06-24 07:26:30 -04:00
parent 25f5af009f
commit baf14f8121
10 changed files with 232 additions and 13 deletions

20
Tox_GUI.sln Normal file
View File

@ -0,0 +1,20 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Tox_GUI", "Tox_GUI\Tox_GUI.vcxproj", "{0A768946-CC65-422E-8F77-47A82452F980}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0A768946-CC65-422E-8F77-47A82452F980}.Debug|Win32.ActiveCfg = Debug|Win32
{0A768946-CC65-422E-8F77-47A82452F980}.Debug|Win32.Build.0 = Debug|Win32
{0A768946-CC65-422E-8F77-47A82452F980}.Release|Win32.ActiveCfg = Release|Win32
{0A768946-CC65-422E-8F77-47A82452F980}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

BIN
Tox_GUI.v11.suo Normal file

Binary file not shown.

94
Tox_GUI/Tox_GUI.vcxproj Normal file
View File

@ -0,0 +1,94 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{0A768946-CC65-422E-8F77-47A82452F980}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>Tox_GUI</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v110</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v110</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<IncludePath>H:\PC\Libraries\wxWidgets-2.9.4\include;H:\PC\Libraries\wxWidgets-2.9.4\include\msvc\wx;$(IncludePath)</IncludePath>
<LibraryPath>H:\PC\Libraries\wxWidgets-2.9.4\lib;H:\PC\Libraries\wxWidgets-2.9.4\lib\vc_lib;$(LibraryPath)</LibraryPath>
<SourcePath>H:\PC\Libraries\wxWidgets-2.9.4\src;$(SourcePath)</SourcePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>wxmsw29ud_core.lib;wxbase29ud.lib;wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexud.lib;wxexpatd.lib;kernel32.lib;user32.lib;gdi32.lib;comdlg32.lib;winspool.lib;winmm.lib;shell32.lib;comctl32.lib;ole32.lib;oleaut32.lib;uuid.lib;rpcrt4.lib;advapi32.lib;wsock32.lib;wininet.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\core\DHT.h" />
<ClInclude Include="gui\home\Home.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\core\DHT.c" />
<ClCompile Include="gui\home\Home.cpp" />
<ClCompile Include="gui\Main.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="core">
<UniqueIdentifier>{0ed343d6-25f7-4c1f-bc25-dbfc0daf81a6}</UniqueIdentifier>
</Filter>
<Filter Include="home">
<UniqueIdentifier>{7095580a-1c7e-48ef-921c-e0ec00efec1c}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="gui\home\Home.h">
<Filter>home</Filter>
</ClInclude>
<ClInclude Include="..\core\DHT.h">
<Filter>core</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="gui\Main.cpp" />
<ClCompile Include="gui\home\Home.cpp">
<Filter>home</Filter>
</ClCompile>
<ClCompile Include="..\core\DHT.c">
<Filter>core</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
</Project>

33
Tox_GUI/gui/Main.cpp Normal file
View File

@ -0,0 +1,33 @@
#include <wx\wx.h>
#include "home\Home.h"
class Tox : public wxApp
{
public:
virtual bool OnInit();
};
bool Tox::OnInit()
{
Home *home = new Home(wxT("Tox"));
home->Show(true);
return true;
}
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE prevInstance, LPWSTR lpCmdLine, int nShowCmd)
{
char *buf;
buf = new char[wcslen(lpCmdLine) + 1];
wcstombs(buf, lpCmdLine, wcslen(lpCmdLine) +1);
wxApp::SetInstance( new Tox());
wxEntry(hInstance, prevInstance, buf, nShowCmd);
wxEntryCleanup();
}

28
Tox_GUI/gui/home/Home.cpp Normal file
View File

@ -0,0 +1,28 @@
#include <wx\textdlg.h>
#include "Home.h"
Home::Home(const wxString& title)
: wxFrame(NULL, wxID_ANY, title, wxDefaultPosition, wxSize(750, 450))
{
wxPanel * panel = new wxPanel(this, -1);
wxBoxSizer *hbox = new wxBoxSizer(wxHORIZONTAL);
netlogList = new wxListBox(panel, ID_LISTBOX,
wxPoint(-1, -1), wxSize(-1, -1));
hbox->Add(netlogList, 3, wxEXPAND | wxALL, 20);
panel->SetSizer(hbox);
Centre();
netlogList->Append("Testing...");
}
void Home::AddNew(wxCommandEvent& event)
{
wxString str = wxGetTextFromUser(wxT("Add new item"));
if (str.Len() > 0)
netlogList->Append(str);
}

13
Tox_GUI/gui/home/Home.h Normal file
View File

@ -0,0 +1,13 @@
#include <wx\wx.h>
class Home : public wxFrame
{
public:
Home(const wxString& title);
void AddNew(wxCommandEvent& event);
wxListBox *netlogList;
};
const int ID_LISTBOX = 1;

View File

@ -16,9 +16,9 @@ int ping(IP_Port ip_port)
char data[37];
data[0] = 00;
memcpy(data + 5, self_client_id, 32);
ADDR addr = {.family = AF_INET, .ip = ip_port.ip, .port = ip_port.port};
//ADDR addr = {.family = AF_INET, .ip = ip_port.ip, .port = ip_port.port};
return sendto(sock, data, sizeof(data) - 1, 0, (struct sockaddr *)&addr, addrlen);
//return sendto(sock, data, sizeof(data) - 1, 0, (struct sockaddr *)&addr, addrlen);
//sendto(int socket_descriptor, char *buffer, int buffer_length, int flags, struct sockaddr *destination_address, int address_length);
}
@ -36,7 +36,7 @@ void addfriend(char * client_id)
char delfriend(char * client_id);
char delfriend(char * client_id)
{
@ -61,7 +61,6 @@ IP_Port getfriendip(char * client_id)
void DHT_recvpacket(char * packet, uint32_t length)
{
}
@ -84,3 +83,4 @@ void bootstrap(IP_Port ip_port)
}

View File

@ -4,13 +4,10 @@
#include <string.h>
#include <time.h>
#ifdef WIN32
#ifdef WIN32 //Put win32 includes here
//Put win32 includes here
#include <windows.h>
#include <winsock2.h>
#include <windows.h>
#else //Linux includes
@ -117,3 +114,5 @@ uint16_t num_friends;
Pinged pings[128];
Pinged send_nodes[64];