Author: janderwald
Date: Mon Jan 1 17:59:05 2007
New Revision: 25265
URL:
http://svn.reactos.org/svn/reactos?rev=25265&view=rev
Log:
- msvc compability fix...
Added:
trunk/reactos/base/applications/downloader/rsrc.rc (with props)
Removed:
trunk/reactos/base/applications/downloader/resources/generic.rc
Modified:
trunk/reactos/base/applications/downloader/download.c
trunk/reactos/base/applications/downloader/downloader.rc
trunk/reactos/base/applications/downloader/main.c
trunk/reactos/base/applications/downloader/resources.h (props changed)
trunk/reactos/base/applications/downloader/structures.h (props changed)
trunk/reactos/base/applications/downloader/xml.c
Modified: trunk/reactos/base/applications/downloader/download.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/download…
==============================================================================
--- trunk/reactos/base/applications/downloader/download.c (original)
+++ trunk/reactos/base/applications/downloader/download.c Mon Jan 1 17:59:05 2007
@@ -1,4 +1,4 @@
-/*
+/* $Id$
* PROJECT: ReactOS Downloader (was GetFirefox)
* LICENSE: GPL - See COPYING in the top level directory
* FILE: base/applications/downloader/download.c
Modified: trunk/reactos/base/applications/downloader/downloader.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/download…
==============================================================================
--- trunk/reactos/base/applications/downloader/downloader.rc (original)
+++ trunk/reactos/base/applications/downloader/downloader.rc Mon Jan 1 17:59:05 2007
@@ -7,6 +7,4 @@
#include <reactos/version.rc>
-#include "resources/generic.rc"
-#include "translations/en.rc"
-#include "translations/de.rc"
+#include "rsrc.rc"
Modified: trunk/reactos/base/applications/downloader/main.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/download…
==============================================================================
--- trunk/reactos/base/applications/downloader/main.c (original)
+++ trunk/reactos/base/applications/downloader/main.c Mon Jan 1 17:59:05 2007
@@ -1,4 +1,4 @@
-/*
+/* $Id$
* PROJECT: ReactOS Downloader
* LICENSE: GPL - See COPYING in the top level directory
* FILE: base/applications/downloader/xml.c
@@ -30,10 +30,11 @@
void ShowMessage (WCHAR* title, WCHAR* message)
{
+ HWND hwnd;
DescriptionHeadline = title;
DescriptionText = message;
- HWND hwnd = GetParent(hCategories);
+ hwnd = GetParent(hCategories);
InvalidateRect(hwnd,NULL,TRUE);
UpdateWindow(hwnd);
}
@@ -63,6 +64,7 @@
void CategoryChoosen (HWND hwnd, struct Category* Category)
{
struct Application* CurrentApplication;
+ TV_INSERTSTRUCTW Insert;
SelectedApplication = NULL;
if(Category->Children && !Category->Apps)
@@ -77,7 +79,6 @@
(void)TreeView_DeleteItem(hwnd, TVI_ROOT);
(void)TreeView_DeleteItem(hwnd, TVI_ROOT); // Delete twice to bypass bug in windows
- TV_INSERTSTRUCTW Insert;
Insert.item.mask = TVIF_TEXT|TVIF_PARAM;
Insert.hInsertAfter = TVI_LAST;
Insert.hParent = TVI_ROOT;
@@ -96,6 +97,8 @@
BOOL SetupControls (HWND hwnd)
{
+ TV_INSERTSTRUCTW Insert = {0};
+ HIMAGELIST hImageList;
HINSTANCE hInstance = GetModuleHandle(NULL);
// Parse the XML file
@@ -121,14 +124,13 @@
SendMessageW(hDownloadButton, BM_SETIMAGE,
(WPARAM)IMAGE_BITMAP,(LPARAM)(HANDLE)LoadBitmap(hInstance,
MAKEINTRESOURCE(IDB_DOWNLOAD)));
// Set deflaut entry for hApps
- TV_INSERTSTRUCTW Insert = {0};
Insert.item.mask = TVIF_TEXT;
Insert.item.pszText = Strings[IDS_CHOOSE_CATEGORY];
Insert.item.cchTextMax = lstrlenW(Strings[IDS_CHOOSE_CATEGORY]);
SendMessage(hApps, TVM_INSERTITEM, 0, (LPARAM)&Insert);
// Create Tree Icons
- HIMAGELIST hImageList = ImageList_Create(16, 16, ILC_COLORDDB, 1, 1);
+ hImageList = ImageList_Create(16, 16, ILC_COLORDDB, 1, 1);
SendMessageW(hCategories, TVM_SETIMAGELIST, TVSIL_NORMAL,
(LPARAM)(HIMAGELIST)hImageList);
SendMessageW(hApps, TVM_SETIMAGELIST, TVSIL_NORMAL, (LPARAM)(HIMAGELIST)hImageList);
@@ -168,11 +170,13 @@
HFONT GetFont (BOOL Title)
{
+ int Height;
+ int Scale;
LOGFONT Font;
GetObject(GetStockObject(DEFAULT_GUI_FONT), sizeof(LOGFONT), &Font);
- int Height = Title ? 20 : 19;
- int Scale = Font.lfWidth/Font.lfHeight;
+ Height = Title ? 20 : 19;
+ Scale = Font.lfWidth/Font.lfHeight;
return CreateFont(Height, Height*Scale, Font.lfEscapement, Font.lfOrientation, Title ?
FW_EXTRABOLD : FW_NORMAL, Font.lfItalic,
Font.lfUnderline, Font.lfStrikeOut, Font.lfCharSet, Font.lfOutPrecision,
Font.lfClipPrecision, Font.lfQuality,
@@ -182,6 +186,8 @@
static void DrawDescription (HDC hdc, RECT DescriptionRect)
{
int i;
+ HFONT Font;
+ RECT Rect = {DescriptionRect.left+5, DescriptionRect.top+3, DescriptionRect.right-2,
DescriptionRect.top+22};
// Backgroud
Rectangle(hdc, DescriptionRect.left, DescriptionRect.top, DescriptionRect.right,
DescriptionRect.bottom);
@@ -191,9 +197,8 @@
DrawBitmap(hdc, i, DescriptionRect.top+22, hUnderline); // less code then stretching
;)
// Headline
- HFONT Font = GetFont(TRUE);
+ Font = GetFont(TRUE);
SelectObject(hdc, Font);
- RECT Rect = {DescriptionRect.left+5, DescriptionRect.top+3, DescriptionRect.right-2,
DescriptionRect.top+22};
DrawTextW(hdc, DescriptionHeadline, lstrlenW(DescriptionHeadline), &Rect,
DT_SINGLELINE|DT_NOPREFIX);
DeleteObject(Font);
@@ -298,15 +303,21 @@
{
int Split_Hozizontal = (HIWORD(lParam)-(45+60))/2 + 60;
int Split_Vertical = 200;
+ RECT Rect = {Split_Vertical+5, Split_Hozizontal+5, LOWORD(lParam)-10,
HIWORD(lParam)-50};
+ RECT Top = {0,0,LOWORD(lParam),60};
+ RECT Bottom = {Split_Vertical, Split_Hozizontal, LOWORD(lParam), HIWORD(lParam)};
ResizeControl(hCategories, 10, 60, Split_Vertical, HIWORD(lParam)-10);
ResizeControl(hApps, Split_Vertical+5, 60, LOWORD(lParam)-10, Split_Hozizontal);
- RECT Rect = {Split_Vertical+5, Split_Hozizontal+5, LOWORD(lParam)-10,
HIWORD(lParam)-50};
DescriptionRect = Rect;
MoveWindow(hHelpButton, LOWORD(lParam)-50, 10, 40, 40, FALSE);
MoveWindow(hUpdateButton, LOWORD(lParam)-100, 10, 40, 40, FALSE);
MoveWindow(hDownloadButton, (Split_Vertical+LOWORD(lParam))/2-70, HIWORD(lParam)-45,
140, 35, FALSE);
+
+
+ InvalidateRect(hwnd, &Top, TRUE);
+ InvalidateRect(hwnd, &Bottom, FALSE);
}
break;
@@ -329,6 +340,8 @@
{
HWND hwnd;
int i;
+ WNDCLASSEXW WndClass = {0};
+ MSG msg;
InitCommonControls();
@@ -337,7 +350,6 @@
LoadStringW(hInstance, i, Strings[i], MAX_STRING_LENGHT); // if you know a better
method please tell me.
// Create the window
- WNDCLASSEXW WndClass = {0};
WndClass.cbSize = sizeof(WNDCLASSEX);
WndClass.lpszClassName = L"Downloader";
WndClass.lpfnWndProc = WndProc;
@@ -363,7 +375,6 @@
UpdateWindow(hwnd);
// Message Loop
- MSG msg;
while(GetMessage(&msg,NULL,0,0))
{
TranslateMessage(&msg);
Propchange: trunk/reactos/base/applications/downloader/resources.h
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords (removed)
@@ -1,1 +1,0 @@
-Author Date Id Revision
Removed: trunk/reactos/base/applications/downloader/resources/generic.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/download…
==============================================================================
--- trunk/reactos/base/applications/downloader/resources/generic.rc (original)
+++ trunk/reactos/base/applications/downloader/resources/generic.rc (removed)
@@ -1,18 +1,0 @@
-LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
-
-IDI_MAIN ICON DISCARDABLE "main.ico"
-//IDB_UNDERLINE BITMAP DISCARDABLE "underline.bmp"
-IDB_LOGO BITMAP DISCARDABLE "logo.bmp"
-IDB_HELP BITMAP DISCARDABLE "help.bmp"
-IDB_UPDATE BITMAP DISCARDABLE "update.bmp"
-IDB_DOWNLOAD BITMAP DISCARDABLE "download.bmp"
-IDB_UNDERLINE BITMAP DISCARDABLE "underline.bmp"
-IDB_TREEVIEW_ICON_0 BITMAP DISCARDABLE "0.bmp"
-IDB_TREEVIEW_ICON_1 BITMAP DISCARDABLE "1.bmp"
-IDB_TREEVIEW_ICON_2 BITMAP DISCARDABLE "2.bmp"
-IDB_TREEVIEW_ICON_3 BITMAP DISCARDABLE "3.bmp"
-IDB_TREEVIEW_ICON_4 BITMAP DISCARDABLE "4.bmp"
-IDB_TREEVIEW_ICON_5 BITMAP DISCARDABLE "5.bmp"
-IDB_TREEVIEW_ICON_6 BITMAP DISCARDABLE "6.bmp"
-IDB_TREEVIEW_ICON_7 BITMAP DISCARDABLE "7.bmp"
-IDB_TREEVIEW_ICON_8 BITMAP DISCARDABLE "8.bmp"
Added: trunk/reactos/base/applications/downloader/rsrc.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/download…
==============================================================================
--- trunk/reactos/base/applications/downloader/rsrc.rc (added)
+++ trunk/reactos/base/applications/downloader/rsrc.rc Mon Jan 1 17:59:05 2007
@@ -1,0 +1,22 @@
+LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
+
+IDI_MAIN ICON DISCARDABLE "resources/main.ico"
+//IDB_UNDERLINE BITMAP DISCARDABLE "resources/underline.bmp"
+IDB_LOGO BITMAP DISCARDABLE "resources/logo.bmp"
+IDB_HELP BITMAP DISCARDABLE "resources/help.bmp"
+IDB_UPDATE BITMAP DISCARDABLE "resources/update.bmp"
+IDB_DOWNLOAD BITMAP DISCARDABLE "resources/download.bmp"
+IDB_UNDERLINE BITMAP DISCARDABLE "resources/underline.bmp"
+IDB_TREEVIEW_ICON_0 BITMAP DISCARDABLE "resources/0.bmp"
+IDB_TREEVIEW_ICON_1 BITMAP DISCARDABLE "resources/1.bmp"
+IDB_TREEVIEW_ICON_2 BITMAP DISCARDABLE "resources/2.bmp"
+IDB_TREEVIEW_ICON_3 BITMAP DISCARDABLE "resources/3.bmp"
+IDB_TREEVIEW_ICON_4 BITMAP DISCARDABLE "resources/4.bmp"
+IDB_TREEVIEW_ICON_5 BITMAP DISCARDABLE "resources/5.bmp"
+IDB_TREEVIEW_ICON_6 BITMAP DISCARDABLE "resources/6.bmp"
+IDB_TREEVIEW_ICON_7 BITMAP DISCARDABLE "resources/7.bmp"
+IDB_TREEVIEW_ICON_8 BITMAP DISCARDABLE "resources/8.bmp"
+
+
+#include "translations/en.rc"
+#include "translations/de.rc"
Propchange: trunk/reactos/base/applications/downloader/rsrc.rc
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: trunk/reactos/base/applications/downloader/structures.h
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords (removed)
@@ -1,1 +1,0 @@
-Author Date Id Revision
Modified: trunk/reactos/base/applications/downloader/xml.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/download…
==============================================================================
--- trunk/reactos/base/applications/downloader/xml.c (original)
+++ trunk/reactos/base/applications/downloader/xml.c Mon Jan 1 17:59:05 2007
@@ -1,4 +1,4 @@
-/*
+/* $Id$
* PROJECT: ReactOS Downloader
* LICENSE: GPL - See COPYING in the top level directory
* FILE: base\applications\downloader\xml.c
@@ -21,6 +21,8 @@
void tag_opened (void* usrdata, const char* tag, const char** arg)
{
+ int i;
+
if(!strcmp(tag, "tree") && !CurrentApplication)
{
// check version
@@ -49,7 +51,6 @@
}
TagOpen = TRUE;
- int i;
for (i=0; arg[i]; i+=2)
{
if(!strcmp(arg[i], "name"))
@@ -81,7 +82,6 @@
CurrentApplication = Current->Apps;
}
- int i;
for (i=0; arg[i]; i+=2)
{
if(!strcmp(arg[i], "name"))
@@ -147,6 +147,8 @@
{
int done = 0;
char buffer[255];
+ FILE* file;
+ XML_Parser parser;
if(Current)
return FALSE;
@@ -154,7 +156,7 @@
Current = Root;
TagOpen = TRUE;
- FILE* file = fopen(filename, "r");
+ file = fopen(filename, "r");
if(!file)
{
file = fopen("downloader.xml", "r");
@@ -165,7 +167,7 @@
}
}
- XML_Parser parser = XML_ParserCreate(NULL);
+ parser = XML_ParserCreate(NULL);
XML_SetElementHandler(parser, tag_opened, tag_closed);
XML_SetCharacterDataHandler(parser, text);