Prvo crtanje vo zivot

This commit is contained in:
Vladan Popovic 2019-07-25 01:22:02 +02:00
commit b26be968a9
41 changed files with 2151 additions and 0 deletions

19
crtanjeOOP/UpgradeLog.XML Executable file
View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type='text/xsl' href='_UpgradeReport_Files/UpgradeReport.xslt'?><UpgradeLog>
<Properties><Property Name="Solution" Value="crtanjeOOP">
</Property><Property Name="Solution File" Value="D:\knigi\crtanjeOOP\crtanjeOOP\crtanjeOOP.sln">
</Property><Property Name="User Options File" Value="D:\knigi\crtanjeOOP\crtanjeOOP\crtanjeOOP.suo">
</Property><Property Name="Date" Value="петок, 12 јануари 2007">
</Property><Property Name="Time" Value="23:03">
</Property></Properties><Event ErrorLevel="0" Project="" Source="crtanjeOOP.sln" Description="File successfully backed up as D:\knigi\crtanjeOOP\crtanjeOOP\crtanjeOOP.sln.old">
</Event><Event ErrorLevel="0" Project="" Source="crtanjeOOP.suo" Description="File successfully backed up as D:\knigi\crtanjeOOP\crtanjeOOP\crtanjeOOP.suo.old">
</Event><Event ErrorLevel="0" Project="crtanjeOOP" Source="crtanjeOOP\crtanjeOOP.vcproj" Description="Visual C++ now supports a secure version of the C Runtime Library. Use of this library is turned on by default. You may see some warnings about deprecated functions when you build your project. It is advised that you correct these warnings, in order to make your code more secure.">
</Event><Event ErrorLevel="0" Project="crtanjeOOP" Source="crtanjeOOP\crtanjeOOP.vcproj" Description="The C/C++ compiler default settings have been modified to be more compliant with ISO Standard C++. Included in those changes are enforcing Standard C++ for loop scoping and supporting wchar_t as a native type. These changes may cause existing code to no longer compile without changes to the code or the compiler options with which it is built.">
</Event><Event ErrorLevel="0" Project="crtanjeOOP" Source="crtanjeOOP\crtanjeOOP.vcproj" Description="The single-threaded run-time library switches (/MLd, /ML) have been removed from the C++ compiler. The project has been automatically converted to use the corresponding multi-threaded run-time library switches (/MTd, /MT).">
</Event><Event ErrorLevel="1" Project="crtanjeOOP" Source="crtanjeOOP\crtanjeOOP.vcproj" Description="Due to the requirement that Visual C++ projects produce an embedded (by default) Windows SxS manifest, manifest files in the project are automatically excluded from building with the Manifest Tool. It is recommended that the dependency information contained in any manifest files be converted to &quot;#pragma comment(linker,&quot;&lt;insert dependency here&gt;&quot;)&quot; in a header file that is included from your source code. If your project already embeds a manifest in the RT_MANIFEST resource section through a resource (.rc) file, the line will need to be commented out before the project will build correctly.">
</Event><Event ErrorLevel="1" Project="crtanjeOOP" Source="crtanjeOOP\crtanjeOOP.vcproj" Description="Due to a conformance change in the C++ compiler, code change may be required before your project will build without errors. Previous versions of the C++ compiler allowed specification of member function pointers by member function name (e.g. MemberFunctionName). The C++ standard requires a fully qualified name with the use of the address-of operator (e.g. &amp;ClassName::MemberFunctionName). If your project contains forms or controls used in the Windows Forms Designer, you may have to change code in InitializeComponent because the designer generated code used the non-conformant syntax in delegate construction (used in event handlers).">
</Event><Event ErrorLevel="0" Project="crtanjeOOP" Source="crtanjeOOP\crtanjeOOP.vcproj" Description="Project file successfully backed up as 'D:\knigi\crtanjeOOP\crtanjeOOP\crtanjeOOP\crtanjeOOP.vcproj.7.10.old'.">
</Event><Event ErrorLevel="0" Project="crtanjeOOP" Source="crtanjeOOP\crtanjeOOP.vcproj" Description="Project upgraded successfully.">
</Event><Event ErrorLevel="3" Project="crtanjeOOP" Source="crtanjeOOP\crtanjeOOP.vcproj" Description="Converted">
</Event><Event ErrorLevel="0" Project="" Source="crtanjeOOP.sln" Description="Solution converted successfully">
</Event><Event ErrorLevel="3" Project="" Source="crtanjeOOP.sln" Description="Converted">
</Event></UpgradeLog>

View File

@ -0,0 +1,207 @@
BODY
{
BACKGROUND-COLOR: white;
FONT-FAMILY: "Verdana", sans-serif;
FONT-SIZE: 100%;
MARGIN-LEFT: 0px;
MARGIN-TOP: 0px
}
P
{
FONT-FAMILY: "Verdana", sans-serif;
FONT-SIZE: 70%;
LINE-HEIGHT: 12pt;
MARGIN-BOTTOM: 0px;
MARGIN-LEFT: 10px;
MARGIN-TOP: 10px
}
.note
{
BACKGROUND-COLOR: #ffffff;
COLOR: #336699;
FONT-FAMILY: "Verdana", sans-serif;
FONT-SIZE: 100%;
MARGIN-BOTTOM: 0px;
MARGIN-LEFT: 0px;
MARGIN-TOP: 0px;
PADDING-RIGHT: 10px
}
.infotable
{
BACKGROUND-COLOR: #f0f0e0;
BORDER-BOTTOM: #ffffff 0px solid;
BORDER-COLLAPSE: collapse;
BORDER-LEFT: #ffffff 0px solid;
BORDER-RIGHT: #ffffff 0px solid;
BORDER-TOP: #ffffff 0px solid;
FONT-SIZE: 70%;
MARGIN-LEFT: 10px
}
.issuetable
{
BACKGROUND-COLOR: #ffffe8;
BORDER-COLLAPSE: collapse;
COLOR: #000000;
FONT-SIZE: 100%;
MARGIN-BOTTOM: 10px;
MARGIN-LEFT: 13px;
MARGIN-TOP: 0px
}
.issuetitle
{
BACKGROUND-COLOR: #ffffff;
BORDER-BOTTOM: #dcdcdc 1px solid;
BORDER-TOP: #dcdcdc 1px;
COLOR: #003366;
FONT-WEIGHT: normal
}
.header
{
BACKGROUND-COLOR: #cecf9c;
BORDER-BOTTOM: #ffffff 1px solid;
BORDER-LEFT: #ffffff 1px solid;
BORDER-RIGHT: #ffffff 1px solid;
BORDER-TOP: #ffffff 1px solid;
COLOR: #000000;
FONT-WEIGHT: bold
}
.issuehdr
{
BACKGROUND-COLOR: #E0EBF5;
BORDER-BOTTOM: #dcdcdc 1px solid;
BORDER-TOP: #dcdcdc 1px solid;
COLOR: #000000;
FONT-WEIGHT: normal
}
.issuenone
{
BACKGROUND-COLOR: #ffffff;
BORDER-BOTTOM: 0px;
BORDER-LEFT: 0px;
BORDER-RIGHT: 0px;
BORDER-TOP: 0px;
COLOR: #000000;
FONT-WEIGHT: normal
}
.content
{
BACKGROUND-COLOR: #e7e7ce;
BORDER-BOTTOM: #ffffff 1px solid;
BORDER-LEFT: #ffffff 1px solid;
BORDER-RIGHT: #ffffff 1px solid;
BORDER-TOP: #ffffff 1px solid;
PADDING-LEFT: 3px
}
.issuecontent
{
BACKGROUND-COLOR: #ffffff;
BORDER-BOTTOM: #dcdcdc 1px solid;
BORDER-TOP: #dcdcdc 1px solid;
PADDING-LEFT: 3px
}
A:link
{
COLOR: #cc6633;
TEXT-DECORATION: underline
}
A:visited
{
COLOR: #cc6633;
}
A:active
{
COLOR: #cc6633;
}
A:hover
{
COLOR: #cc3300;
TEXT-DECORATION: underline
}
H1
{
BACKGROUND-COLOR: #003366;
BORDER-BOTTOM: #336699 6px solid;
COLOR: #ffffff;
FONT-SIZE: 130%;
FONT-WEIGHT: normal;
MARGIN: 0em 0em 0em -20px;
PADDING-BOTTOM: 8px;
PADDING-LEFT: 30px;
PADDING-TOP: 16px
}
H2
{
COLOR: #000000;
FONT-SIZE: 80%;
FONT-WEIGHT: bold;
MARGIN-BOTTOM: 3px;
MARGIN-LEFT: 10px;
MARGIN-TOP: 20px;
PADDING-LEFT: 0px
}
H3
{
COLOR: #000000;
FONT-SIZE: 80%;
FONT-WEIGHT: bold;
MARGIN-BOTTOM: -5px;
MARGIN-LEFT: 10px;
MARGIN-TOP: 20px
}
H4
{
COLOR: #000000;
FONT-SIZE: 70%;
FONT-WEIGHT: bold;
MARGIN-BOTTOM: 0px;
MARGIN-TOP: 15px;
PADDING-BOTTOM: 0px
}
UL
{
COLOR: #000000;
FONT-SIZE: 70%;
LIST-STYLE: square;
MARGIN-BOTTOM: 0pt;
MARGIN-TOP: 0pt
}
OL
{
COLOR: #000000;
FONT-SIZE: 70%;
LIST-STYLE: square;
MARGIN-BOTTOM: 0pt;
MARGIN-TOP: 0pt
}
LI
{
LIST-STYLE: square;
MARGIN-LEFT: 0px
}
.expandable
{
CURSOR: hand
}
.expanded
{
color: black
}
.collapsed
{
DISPLAY: none
}
.foot
{
BACKGROUND-COLOR: #ffffff;
BORDER-BOTTOM: #cecf9c 1px solid;
BORDER-TOP: #cecf9c 2px solid
}
.settings
{
MARGIN-LEFT: 25PX;
}
.help
{
TEXT-ALIGN: right;
margin-right: 10px;
}

View File

@ -0,0 +1,232 @@
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl='urn:schemas-microsoft-com:xslt'>
<xsl:key name="ProjectKey" match="Event" use="@Project" />
<xsl:template match="Events" mode="createProjects">
<projects>
<xsl:for-each select="Event">
<!--xsl:sort select="@Project" order="descending"/-->
<xsl:if test="(1=position()) or (preceding-sibling::*[1]/@Project != @Project)">
<xsl:variable name="ProjectName" select="@Project"/>
<project>
<xsl:attribute name="name">
<xsl:value-of select="@Project"/>
</xsl:attribute>
<xsl:if test="@Project=''">
<xsl:attribute name="solution">
<xsl:value-of select="@Solution"/>
</xsl:attribute>
</xsl:if>
<xsl:for-each select="key('ProjectKey', $ProjectName)">
<!--xsl:sort select="@Source" /-->
<xsl:if test="(1=position()) or (preceding-sibling::*[1]/@Source != @Source)">
<source>
<xsl:attribute name="name">
<xsl:value-of select="@Source"/>
</xsl:attribute>
<xsl:variable name="Source">
<xsl:value-of select="@Source"/>
</xsl:variable>
<xsl:for-each select="key('ProjectKey', $ProjectName)[ @Source = $Source ]">
<event>
<xsl:attribute name="error-level">
<xsl:value-of select="@ErrorLevel"/>
</xsl:attribute>
<xsl:attribute name="description">
<xsl:value-of select="@Description"/>
</xsl:attribute>
</event>
</xsl:for-each>
</source>
</xsl:if>
</xsl:for-each>
</project>
</xsl:if>
</xsl:for-each>
</projects>
</xsl:template>
<xsl:template match="projects">
<xsl:for-each select="project">
<xsl:sort select="@Name" order="ascending"/>
<h2>
<xsl:if test="@solution">Solution: <xsl:value-of select="@solution"/></xsl:if>
<xsl:if test="not(@solution)">Project: <xsl:value-of select="@name"/>
<xsl:for-each select="source">
<xsl:variable name="Hyperlink" select="@name"/>
<xsl:for-each select="event[@error-level='4']">
&#32;<A class="note"><xsl:attribute name="HREF"><xsl:value-of select="$Hyperlink"/></xsl:attribute><xsl:value-of select="@description"/></A>
</xsl:for-each>
</xsl:for-each>
</xsl:if>
</h2>
<table cellpadding="2" cellspacing="0" width="98%" border="1" bordercolor="white" class="infotable">
<tr>
<td nowrap="1" class="header" _locID="Filename">Filename</td>
<td nowrap="1" class="header" _locID="Status">Status</td>
<td nowrap="1" class="header" _locID="Errors">Errors</td>
<td nowrap="1" class="header" _locID="Warnings">Warnings</td>
</tr>
<xsl:for-each select="source">
<xsl:sort select="@name" order="ascending"/>
<xsl:variable name="source-id" select="generate-id(.)"/>
<xsl:if test="count(event)!=count(event[@error-level='4'])">
<tr class="row">
<td class="content">
<A HREF="javascript:"><xsl:attribute name="onClick">javascript:document.images['<xsl:value-of select="$source-id"/>'].click()</xsl:attribute><IMG border="0" alt="expand/collapse section" class="expandable" height="11" onclick="changepic()" src="_UpgradeReport_Files/UpgradeReport_Plus.gif" width="9" ><xsl:attribute name="name"><xsl:value-of select="$source-id"/></xsl:attribute><xsl:attribute name="child">src<xsl:value-of select="$source-id"/></xsl:attribute></IMG></A>&#32;<xsl:value-of select="@name"/>
</td>
<td class="content">
<xsl:if test="count(event[@error-level='3'])=1">
<xsl:for-each select="event[@error-level='3']">
<xsl:if test="@description='Converted'">Converted</xsl:if>
<xsl:if test="@description!='Converted'"><xsl:value-of select="@description"/></xsl:if>
</xsl:for-each>
</xsl:if>
<xsl:if test="count(event[@error-level='3'])!=1 and count(event[@error-level='3' and @description='Converted'])!=0">Converted
</xsl:if>
</td>
<td class="content"><xsl:value-of select="count(event[@error-level='2'])"/></td>
<td class="content"><xsl:value-of select="count(event[@error-level='1'])"/></td>
</tr>
<tr class="collapsed" bgcolor="#ffffff">
<xsl:attribute name="id">src<xsl:value-of select="$source-id"/></xsl:attribute>
<td colspan="7">
<table width="97%" border="1" bordercolor="#dcdcdc" rules="cols" class="issuetable">
<tr>
<td colspan="7" class="issuetitle" _locID="ConversionIssues">Conversion Issues - <xsl:value-of select="@name"/>:</td>
</tr>
<xsl:for-each select="event[@error-level!='3']">
<xsl:if test="@error-level!='4'">
<tr>
<td class="issuenone" style="border-bottom:solid 1 lightgray">
<xsl:value-of select="@description"/>
</td>
</tr>
</xsl:if>
</xsl:for-each>
</table>
</td>
</tr>
</xsl:if>
</xsl:for-each>
<tr valign="top">
<td class="foot">
<xsl:if test="count(source)!=1">
<xsl:value-of select="count(source)"/> files
</xsl:if>
<xsl:if test="count(source)=1">
1 file
</xsl:if>
</td>
<td class="foot">
Converted: <xsl:value-of select="count(source/event[@error-level='3' and @description='Converted'])"/><BR />
Not converted <xsl:value-of select="count(source) - count(source/event[@error-level='3' and @description='Converted'])"/>
</td>
<td class="foot"><xsl:value-of select="count(source/event[@error-level='2'])"/></td>
<td class="foot"><xsl:value-of select="count(source/event[@error-level='1'])"/></td>
</tr>
</table>
</xsl:for-each>
</xsl:template>
<xsl:template match="Property">
<xsl:if test="@Name!='Date' and @Name!='Time' and @Name!='LogNumber' and @Name!='Solution'">
<tr><td nowrap="1"><b><xsl:value-of select="@Name"/>: </b><xsl:value-of select="@Value"/></td></tr>
</xsl:if>
</xsl:template>
<xsl:template match="UpgradeLog">
<html>
<head>
<META HTTP-EQUIV="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="_UpgradeReport_Files\UpgradeReport.css" />
<title>Conversion Report&#32;
<xsl:if test="Properties/Property[@Name='LogNumber']">
<xsl:value-of select="Properties/Property[@Name='LogNumber']/@Value"/>
</xsl:if>
</title>
<script language="javascript">
function outliner () {
oMe = window.event.srcElement
//get child element
var child = document.all[event.srcElement.getAttribute("child",false)];
//if child element exists, expand or collapse it.
if (null != child)
child.className = child.className == "collapsed" ? "expanded" : "collapsed";
}
function changepic() {
uMe = window.event.srcElement;
var check = uMe.src.toLowerCase();
if (check.lastIndexOf("upgradereport_plus.gif") != -1)
{
uMe.src = "_UpgradeReport_Files/UpgradeReport_Minus.gif"
}
else
{
uMe.src = "_UpgradeReport_Files/UpgradeReport_Plus.gif"
}
}
</script>
</head>
<body topmargin="0" leftmargin="0" rightmargin="0" onclick="outliner();">
<h1 _locID="ConversionReport">Conversion Report - <xsl:value-of select="Properties/Property[@Name='Solution']/@Value"/></h1>
<p><span class="note">
<b>Time of Conversion:</b>&#32;&#32;<xsl:value-of select="Properties/Property[@Name='Date']/@Value"/>&#32;&#32;<xsl:value-of select="Properties/Property[@Name='Time']/@Value"/><br/>
</span></p>
<xsl:variable name="SortedEvents">
<Events>
<xsl:for-each select="Event">
<xsl:sort select="@Project" order="ascending"/>
<xsl:sort select="@Source" order="ascending"/>
<xsl:sort select="@ErrorLevel" order="ascending"/>
<Event>
<xsl:attribute name="Project"><xsl:value-of select="@Project"/> </xsl:attribute>
<xsl:attribute name="Solution"><xsl:value-of select="/UpgradeLog/Properties/Property[@Name='Solution']/@Value"/> </xsl:attribute>
<xsl:attribute name="Source"><xsl:value-of select="@Source"/> </xsl:attribute>
<xsl:attribute name="ErrorLevel"><xsl:value-of select="@ErrorLevel"/> </xsl:attribute>
<xsl:attribute name="Description"><xsl:value-of select="@Description"/> </xsl:attribute>
</Event>
</xsl:for-each>
</Events>
</xsl:variable>
<xsl:variable name="Projects">
<xsl:apply-templates select="msxsl:node-set($SortedEvents)/*" mode="createProjects"/>
</xsl:variable>
<xsl:apply-templates select="msxsl:node-set($Projects)/*"/>
<p></p><p>
<table class="note">
<tr>
<td nowrap="1">
<b>Conversion Settings</b>
</td>
</tr>
<xsl:apply-templates select="Properties"/>
</table></p>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 B

BIN
crtanjeOOP/crtanjeOOP.ncb Executable file

Binary file not shown.

19
crtanjeOOP/crtanjeOOP.sln Executable file
View File

@ -0,0 +1,19 @@
Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "crtanjeOOP", "crtanjeOOP\crtanjeOOP.vcproj", "{C4425E09-9576-42ED-B986-0337C69BC434}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C4425E09-9576-42ED-B986-0337C69BC434}.Debug|Win32.ActiveCfg = Debug|Win32
{C4425E09-9576-42ED-B986-0337C69BC434}.Debug|Win32.Build.0 = Debug|Win32
{C4425E09-9576-42ED-B986-0337C69BC434}.Release|Win32.ActiveCfg = Release|Win32
{C4425E09-9576-42ED-B986-0337C69BC434}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

21
crtanjeOOP/crtanjeOOP.sln.old Executable file
View File

@ -0,0 +1,21 @@
Microsoft Visual Studio Solution File, Format Version 8.00
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "crtanjeOOP", "crtanjeOOP\crtanjeOOP.vcproj", "{C4425E09-9576-42ED-B986-0337C69BC434}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
Debug = Debug
Release = Release
EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution
{C4425E09-9576-42ED-B986-0337C69BC434}.Debug.ActiveCfg = Debug|Win32
{C4425E09-9576-42ED-B986-0337C69BC434}.Debug.Build.0 = Debug|Win32
{C4425E09-9576-42ED-B986-0337C69BC434}.Release.ActiveCfg = Release|Win32
{C4425E09-9576-42ED-B986-0337C69BC434}.Release.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection
GlobalSection(ExtensibilityAddIns) = postSolution
EndGlobalSection
EndGlobal

BIN
crtanjeOOP/crtanjeOOP.suo Executable file

Binary file not shown.

BIN
crtanjeOOP/crtanjeOOP.suo.old Executable file

Binary file not shown.

View File

@ -0,0 +1,53 @@
========================================================================
WIN32 APPLICATION : crtanjeOOP Project Overview
========================================================================
AppWizard has created this crtanjeOOP application for you.
This file contains a summary of what you will find in each of the files that
make up your crtanjeOOP application.
crtanjeOOP.vcproj
This is the main project file for VC++ projects generated using an Application Wizard.
It contains information about the version of Visual C++ that generated the file, and
information about the platforms, configurations, and project features selected with the
Application Wizard.
crtanjeOOP.cpp
This is the main application source file.
/////////////////////////////////////////////////////////////////////////////
AppWizard has created the following resources:
crtanjeOOP.rc
This is a listing of all of the Microsoft Windows resources that the
program uses. It includes the icons, bitmaps, and cursors that are stored
in the RES subdirectory. This file can be directly edited in Microsoft
Visual C++.
Resource.h
This is the standard header file, which defines new resource IDs.
Microsoft Visual C++ reads and updates this file.
crtanjeOOP.ico
This is an icon file, which is used as the application's icon (32x32).
This icon is included by the main resource file crtanjeOOP.rc.
small.ico
This is an icon file, which contains a smaller version (16x16)
of the application's icon. This icon is included by the main resource
file crtanjeOOP.rc.
/////////////////////////////////////////////////////////////////////////////
Other standard files:
StdAfx.h, StdAfx.cpp
These files are used to build a precompiled header (PCH) file
named crtanjeOOP.pch and a precompiled types file named StdAfx.obj.
/////////////////////////////////////////////////////////////////////////////
Other notes:
AppWizard uses "TODO:" comments to indicate parts of the source code you
should add to or customize.
/////////////////////////////////////////////////////////////////////////////

Binary file not shown.

View File

@ -0,0 +1,32 @@
#include "stdafx.h"
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
MSG msg;
HACCEL hAccelTable;
Win::Class wClass((WNDPROC)WndProc, "MainWinClass", hInstance);
wClass.Register();
Win::Maker wMaker("MainWinClass", 100, 100, CW_USEDEFAULT,
CW_USEDEFAULT, 0, 0, hInstance);
wMaker.Create("Crtanje", WS_OVERLAPPEDWINDOW);
wMaker.Show();
hAccelTable = LoadAccelerators(hInstance, (LPCTSTR)IDC_CRTANJEOOP);
while (GetMessage(&msg, NULL, 0, 0))
{
if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
return (int) msg.wParam;
}

View File

@ -0,0 +1,3 @@
#pragma once
#include "resource.h"

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

View File

@ -0,0 +1,174 @@
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#define APSTUDIO_HIDDEN_SYMBOLS
#include "windows.h"
#undef APSTUDIO_HIDDEN_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_CRTANJEOOP ICON "crtanjeOOP.ico"
IDI_SMALL ICON "small.ico"
/////////////////////////////////////////////////////////////////////////////
//
// Menu
//
IDC_CRTANJEOOP MENU
BEGIN
POPUP "&File"
BEGIN
MENUITEM "E&xit", IDM_EXIT
END
POPUP "&Brush Size"
BEGIN
MENUITEM "Thi&n", ID_BRUSHSIZE_THIN
MENUITEM "Thic&k", ID_BRUSHSIZE_THICK
MENUITEM "&Custom", ID_BRUSHSIZE_CUSTOM
END
POPUP "&Help"
BEGIN
MENUITEM "&About ...", IDM_ABOUT
END
END
/////////////////////////////////////////////////////////////////////////////
//
// Accelerator
//
IDC_CRTANJEOOP ACCELERATORS
BEGIN
"?", IDM_ABOUT, ASCII, ALT
"/", IDM_ABOUT, ASCII, ALT
END
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_ABOUTBOX DIALOG 22, 17, 230, 75
STYLE DS_SETFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "About"
FONT 8, "System"
BEGIN
ICON IDI_CRTANJEOOP,IDC_MYICON,14,9,16,16
LTEXT "crtanjeOOP Version 1.0",IDC_STATIC,49,10,119,8,
SS_NOPREFIX
LTEXT "Copyright (C) 2005",IDC_STATIC,49,20,119,8
DEFPUSHBUTTON "OK",IDOK,195,6,30,11,WS_GROUP
END
IDD_PROPPAGE_SMALL DIALOGEX 0, 0, 120, 62
STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_BORDER
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
DEFPUSHBUTTON "OK",ID_TBUTTON,34,38,52,17
EDITTEXT IDC_EDIT_THICKNESS,7,14,106,15,ES_AUTOHSCROLL |
ES_NUMBER
LTEXT "Enter Size (1..500 pt) : ",IDC_STATIC,7,4,79,8
END
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
BEGIN
"#define APSTUDIO_HIDDEN_SYMBOLS\r\n"
"#include ""windows.h""\r\n"
"#undef APSTUDIO_HIDDEN_SYMBOLS\r\n"
"\0"
END
3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO
BEGIN
IDD_PROPPAGE_SMALL, DIALOG
BEGIN
RIGHTMARGIN, 119
VERTGUIDE, 7
VERTGUIDE, 34
VERTGUIDE, 86
VERTGUIDE, 113
HORZGUIDE, 55
END
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE
BEGIN
IDS_APP_TITLE "crtanjeOOP"
IDC_CRTANJEOOP "CRTANJEOOP"
END
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

View File

@ -0,0 +1,320 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8,00"
Name="crtanjeOOP"
ProjectGUID="{C4425E09-9576-42ED-B986-0337C69BC434}"
Keyword="Win32Proj"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="Debug"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="2"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/crtanjeOOP.exe"
LinkIncremental="2"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)/crtanjeOOP.pdb"
SubSystem="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="Release"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
RuntimeLibrary="0"
UsePrecompiledHeader="2"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/crtanjeOOP.exe"
LinkIncremental="1"
GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\crtanjeOOP.cpp"
>
</File>
<File
RelativePath=".\customDgl_proc.cpp"
>
</File>
<File
RelativePath=".\dateclock.cpp"
>
</File>
<File
RelativePath=".\dlgbox_proc.cpp"
>
</File>
<File
RelativePath=".\lndrawer.cpp"
>
</File>
<File
RelativePath=".\saveline.cpp"
>
</File>
<File
RelativePath=".\screen.cpp"
>
</File>
<File
RelativePath=".\stdafx.cpp"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="1"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="1"
/>
</FileConfiguration>
</File>
<File
RelativePath=".\timer_proc.cpp"
>
</File>
<File
RelativePath=".\win_procedure.cpp"
>
</File>
<File
RelativePath=".\wndclass.cpp"
>
</File>
<File
RelativePath=".\wndcontrol.cpp"
>
</File>
<File
RelativePath=".\wndMaker.cpp"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath=".\crtanjeOOP.h"
>
</File>
<File
RelativePath=".\dateclock.h"
>
</File>
<File
RelativePath=".\lndrawer.h"
>
</File>
<File
RelativePath=".\Resource.h"
>
</File>
<File
RelativePath=".\saveline.h"
>
</File>
<File
RelativePath=".\screen.h"
>
</File>
<File
RelativePath=".\stdafx.h"
>
</File>
<File
RelativePath=".\wndclass.h"
>
</File>
<File
RelativePath=".\wndcontrol.h"
>
</File>
<File
RelativePath=".\wndMaker.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
<File
RelativePath=".\crtanjeOOP.ico"
>
</File>
<File
RelativePath=".\crtanjeOOP.rc"
>
</File>
<File
RelativePath=".\small.ico"
>
</File>
</Filter>
<File
RelativePath=".\ReadMe.txt"
>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -0,0 +1,222 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="crtanjeOOP"
ProjectGUID="{C4425E09-9576-42ED-B986-0337C69BC434}"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="Debug"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="5"
UsePrecompiledHeader="3"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="4"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/crtanjeOOP.exe"
LinkIncremental="2"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="$(OutDir)/crtanjeOOP.pdb"
SubSystem="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="Release"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
RuntimeLibrary="4"
UsePrecompiledHeader="3"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="3"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/crtanjeOOP.exe"
LinkIncremental="1"
GenerateDebugInformation="TRUE"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
<File
RelativePath=".\crtanjeOOP.cpp">
</File>
<File
RelativePath=".\customDgl_proc.cpp">
</File>
<File
RelativePath=".\dateclock.cpp">
</File>
<File
RelativePath=".\dlgbox_proc.cpp">
</File>
<File
RelativePath=".\lndrawer.cpp">
</File>
<File
RelativePath=".\saveline.cpp">
</File>
<File
RelativePath=".\screen.cpp">
</File>
<File
RelativePath=".\stdafx.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="1"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="1"/>
</FileConfiguration>
</File>
<File
RelativePath=".\timer_proc.cpp">
</File>
<File
RelativePath=".\win_procedure.cpp">
</File>
<File
RelativePath=".\wndclass.cpp">
</File>
<File
RelativePath=".\wndcontrol.cpp">
</File>
<File
RelativePath=".\wndMaker.cpp">
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
<File
RelativePath=".\crtanjeOOP.h">
</File>
<File
RelativePath=".\dateclock.h">
</File>
<File
RelativePath=".\lndrawer.h">
</File>
<File
RelativePath=".\Resource.h">
</File>
<File
RelativePath=".\saveline.h">
</File>
<File
RelativePath=".\screen.h">
</File>
<File
RelativePath=".\stdafx.h">
</File>
<File
RelativePath=".\wndclass.h">
</File>
<File
RelativePath=".\wndcontrol.h">
</File>
<File
RelativePath=".\wndMaker.h">
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
<File
RelativePath=".\crtanjeOOP.ico">
</File>
<File
RelativePath=".\crtanjeOOP.rc">
</File>
<File
RelativePath=".\small.ico">
</File>
</Filter>
<File
RelativePath=".\ReadMe.txt">
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioUserFile
ProjectType="Visual C++"
Version="8,00"
ShowAllFiles="false"
>
<Configurations>
<Configuration
Name="Debug|Win32"
>
<DebugSettings
Command="$(TargetPath)"
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="VLADAN-E438F675"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
<Configuration
Name="Release|Win32"
>
<DebugSettings
Command="$(TargetPath)"
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="VLADAN-E438F675"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
</Configurations>
</VisualStudioUserFile>

View File

@ -0,0 +1,39 @@
#include "stdafx.h"
using namespace Win;
LRESULT CALLBACK CustomDlg(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
int nSize;
switch (message)
{
case WM_INITDIALOG:
return TRUE;
case WM_COMMAND:
if (LOWORD(wParam) == ID_TBUTTON || LOWORD(wParam) == IDCANCEL)
{
char cValue[100];
GetDlgItemText(hDlg, IDC_EDIT_THICKNESS, cValue, 100);
if (cValue == "")
nSize = 1;
else
nSize = GetDlgItemInt(hDlg, IDC_EDIT_THICKNESS, NULL, NULL);
if (nSize > 500)
{
MessageBox(hDlg, "Cannot take value > 500", "Alert!", MB_OK);
SetDlgItemText(hDlg, IDC_EDIT_THICKNESS, "");
}
else
{
EndDialog(hDlg, nSize);
SetWindowLong(hDlg, DWL_MSGRESULT, static_cast<LONG>(nSize));
return TRUE;
}
}
break;
}
return FALSE;
}

View File

@ -0,0 +1,14 @@
#include "stdafx.h"
using namespace Win;
char * const CDtClock::ConvertToTxt() const
{
char* cDateTime = new char[100];
sprintf(cDateTime, "Date : %d.%d.%d , Time : %d:%d:%d",
m_sysTime.wDay, m_sysTime.wMonth, m_sysTime.wYear, m_sysTime.wHour,
m_sysTime.wMinute, m_sysTime.wSecond);
return cDateTime;
}

View File

@ -0,0 +1,23 @@
#if _MSC_VER > 1000
#pragma once
#endif
#ifndef _DATECLOCK_H_98C02EFF_AB0F_48fe_928A_6A4F4E96858B
#define _DATECLOCK_H_98C02EFF_AB0F_48fe_928A_6A4F4E96858B
namespace Win
{
class CDtClock
{
public:
CDtClock() : m_sysTime(), m_interval(100)
{ GetLocalTime(&m_sysTime); }
char * const ConvertToTxt() const;
int GetInterval() const { return m_interval; }
private:
SYSTEMTIME m_sysTime;
int m_interval;
};
};
#endif

View File

@ -0,0 +1,19 @@
#include "stdafx.h"
LRESULT CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
case WM_INITDIALOG:
return TRUE;
case WM_COMMAND:
if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
{
EndDialog(hDlg, LOWORD(wParam));
return TRUE;
}
break;
}
return FALSE;
}

View File

@ -0,0 +1,12 @@
#include "stdafx.h"
using namespace Win;
void CLineDrawer::DrawLine(HWND hWnd) const
{
HDC hdc = GetDC(hWnd);
SelectObject(hdc, m_hPen);
::MoveToEx(hdc, m_begin.x, m_begin.y, 0);
::LineTo(hdc, m_end.x, m_end.y);
DeleteObject(m_hPen);
}

View File

@ -0,0 +1,32 @@
#if _MSC_VER > 1000
#pragma once
#endif
#ifndef _LNDRAWER_H_9022FC04_7CE7_4e40_8F1E_6A7B7720E390
#define _LNDRAWER_H_9022FC04_7CE7_4e40_8F1E_6A7B7720E390
// klasa za crtanje linii, se inicijalizira PEN so debelina 1
// vo crna boja , i dvete tocki (pocetnata i krajnata na linijata)
// se inicijaliziraat na 0
namespace Win
{
class CLineDrawer
{
public:
CLineDrawer() : m_hPen(CreatePen(PS_SOLID, 1, RGB(0,0,0))),
m_begin(), m_end() {}
void DrawLine(HWND hWnd) const;
void SetBegin(LPARAM const lParam) { m_begin = MAKEPOINTS(lParam); }
void SetEnd() { m_end = m_begin; }
void UpdatePen(const HPEN hPen) { m_hPen = hPen; }
private:
HPEN m_hPen;
POINTS m_begin;
POINTS m_end;
};
};
#endif

View File

@ -0,0 +1,34 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by crtanjeOOP.rc
//
#define IDC_MYICON 2
#define IDD_CRTANJEOOP_DIALOG 102
#define IDD_PROPPAGE_SMALL 102
#define IDS_APP_TITLE 103
#define IDD_ABOUTBOX 103
#define IDM_ABOUT 104
#define IDM_EXIT 105
#define IDI_CRTANJEOOP 107
#define IDI_SMALL 108
#define IDC_CRTANJEOOP 109
#define ID_TIMER 110
#define IDR_MAINFRAME 128
#define ID_TBUTTON 1001
#define IDC_EDIT_THICKNESS 1002
#define ID_BRUSHSIZE_THIN 32771
#define ID_BRUSHSIZE_THICK 32772
#define ID_BRUSHSIZE_CUSTOM 32773
#define IDC_STATIC -1
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NO_MFC 1
#define _APS_NEXT_RESOURCE_VALUE 129
#define _APS_NEXT_COMMAND_VALUE 32774
#define _APS_NEXT_CONTROL_VALUE 1003
#define _APS_NEXT_SYMED_VALUE 110
#endif
#endif

View File

@ -0,0 +1,25 @@
#include "stdafx.h"
using namespace Win;
void CSaveLine::SavePoint(POINTS point)
{
m_pts[m_counter] = point;
++m_counter;
}
void CSaveLine::DrawLines(HDC hdc)
{
::SelectObject(hdc, m_hpen);
::MoveToEx(hdc, m_pts[0].x, m_pts[0].y, NULL);
::LineTo(hdc, m_pts[0].x, m_pts[0].y);
for (int i = 1; i < m_counter; ++i)
{
::MoveToEx(hdc, m_pts[i].x, m_pts[i].y, NULL);
::LineTo(hdc, m_pts[i].x, m_pts[i].y);
}
::DeleteObject(m_hpen);
}

View File

@ -0,0 +1,26 @@
#if _MSC_VER > 1000
#pragma once
#endif
#ifndef _SAVELINE_H_008F089E_22D5_436f_A8BF_1F425CA40F38
#define _SAVELINE_H_008F089E_22D5_436f_A8BF_1F425CA40F38
namespace Win
{
class CSaveLine
{
public:
CSaveLine() : m_counter(0), m_pts(),
m_hpen(CreatePen(PS_SOLID, 1, RGB(0,0,0))) {}
void SavePoint(POINTS);
void DrawLines(HDC);
private:
int m_counter;
POINTS m_pts[10000];
HPEN m_hpen;
};
};
#endif

View File

@ -0,0 +1,88 @@
#include "stdafx.h"
using namespace Win;
RECT CScreen::GetRect() const
{
RECT rc;
GetClientRect(m_hWnd, &rc);
return rc;
}
void CScreen::DrawRectangle() const
{
HDC hdc = GetDC(m_hWnd);
RECT rc = GetRect();
HBRUSH hBrush = CreateSolidBrush(RGB(200,0,0));
SelectObject(hdc, hBrush);
Rectangle(hdc, 110, 17, rc.right, 0);
DeleteObject(hBrush);
ReleaseDC(m_hWnd, hdc);
}
void CScreen::SetColors() const
{
HDC hdc = GetDC(m_hWnd);
RECT rc = GetRect();
HBRUSH hBrush = CreateSolidBrush(RGB(0, 0, 0)); // crna
SelectObject(hdc, hBrush);
Rectangle(hdc, rc.left + 10, rc.bottom - 50, rc.left + 30, rc.bottom - 10);
DeleteObject(hBrush);
hBrush = CreateSolidBrush(RGB(255, 0, 0)); // crvena
SelectObject(hdc, hBrush);
Rectangle(hdc, rc.left + 30, rc.bottom - 50, rc.left + 50, rc.bottom - 10);
DeleteObject(hBrush);
hBrush = CreateSolidBrush(RGB(255, 255, 0)); // zolta
SelectObject(hdc, hBrush);
Rectangle(hdc, rc.left + 50, rc.bottom - 50, rc.left + 70, rc.bottom - 10);
DeleteObject(hBrush);
hBrush = CreateSolidBrush(RGB(0, 255, 0)); // zelena
SelectObject(hdc, hBrush);
Rectangle(hdc, rc.left + 70, rc.bottom - 50, rc.left + 90, rc.bottom - 10);
DeleteObject(hBrush);
hBrush = CreateSolidBrush(RGB(0, 0, 255)); // plava
SelectObject(hdc, hBrush);
Rectangle(hdc, rc.left + 90, rc.bottom - 50, rc.left + 110, rc.bottom - 10);
DeleteObject(hBrush);
// ------------------------------- vtor red ------------------------------------
hBrush = CreateSolidBrush(RGB(255, 255, 255)); // bela
SelectObject(hdc, hBrush);
Rectangle(hdc, rc.left + 10, rc.bottom - 30, rc.left + 30, rc.bottom - 10);
DeleteObject(hBrush);
hBrush = CreateSolidBrush(RGB(255, 0, 255)); // magenta
SelectObject(hdc, hBrush);
Rectangle(hdc, rc.left + 30, rc.bottom - 30, rc.left + 50, rc.bottom - 10);
DeleteObject(hBrush);
hBrush = CreateSolidBrush(RGB(255, 150, 0)); // portokalova
SelectObject(hdc, hBrush);
Rectangle(hdc, rc.left + 50, rc.bottom - 30, rc.left + 70, rc.bottom - 10);
DeleteObject(hBrush);
hBrush = CreateSolidBrush(RGB(0, 255, 255)); // tirkizna
SelectObject(hdc, hBrush);
Rectangle(hdc, rc.left + 70, rc.bottom - 30, rc.left + 90, rc.bottom - 10);
DeleteObject(hBrush);
hBrush = CreateSolidBrush(RGB(150, 0, 255)); // lilana
SelectObject(hdc, hBrush);
Rectangle(hdc, rc.left + 90, rc.bottom - 30, rc.left + 110, rc.bottom - 10);
DeleteObject(hBrush);
ReleaseDC(m_hWnd, hdc);
}
void CScreen::SetScreen() const
{
DrawRectangle();
SetColors();
}

23
crtanjeOOP/crtanjeOOP/screen.h Executable file
View File

@ -0,0 +1,23 @@
#if _MSC_VER > 1000
#pragma once
#endif
#ifndef _SCREEN_H_27C0DE4D_C111_4e0f_A133_B73A0B68934C
#define _SCREEN_H_27C0DE4D_C111_4e0f_A133_B73A0B68934C
namespace Win
{
class CScreen
{
public:
CScreen(HWND hwnd) : m_hWnd(hwnd) {}
void SetScreen() const;
private:
RECT GetRect() const;
void DrawRectangle() const;
void SetColors() const;
HWND m_hWnd;
};
};
#endif

BIN
crtanjeOOP/crtanjeOOP/small.ico Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

View File

@ -0,0 +1,8 @@
// stdafx.cpp : source file that includes just the standard includes
// crtanjeOOP.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
// TODO: reference any additional headers you need in STDAFX.H
// and not in this file

28
crtanjeOOP/crtanjeOOP/stdafx.h Executable file
View File

@ -0,0 +1,28 @@
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#pragma once
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
// Windows Header Files:
#include <windows.h>
// C RunTime Header Files
#include <stdlib.h>
#include <malloc.h>
#include <memory.h>
#include <tchar.h>
#include "stdio.h"
// TODO: reference additional headers your program requires here
#include "resource.h"
#include "crtanjeOOP.h"
#include "wndclass.h"
#include "wndMaker.h"
#include "lndrawer.h"
#include "wndcontrol.h"
#include "dateclock.h"
#include "screen.h"
#include "saveline.h"

View File

@ -0,0 +1,24 @@
#include "stdafx.h"
using namespace Win;
VOID CALLBACK TimerProc(HWND hWnd, UINT message, UINT iTimerID, DWORD dwTime)
{
Win::CDtClock dtClock;
Win::CScreen Scr(hWnd);
char* dt = dtClock.ConvertToTxt();
RECT rc;
HDC hdc = GetDC (hWnd);
Scr.SetScreen();
GetClientRect (hWnd, &rc);
SetBkColor(hdc, RGB(200, 0, 0));
SetTextColor(hdc, RGB(255, 255, 255));
int len = static_cast<int>(strlen(dt));
DrawText(hdc, dt, len, &rc, DT_RIGHT);
ReleaseDC (hWnd, hdc) ;
}

View File

@ -0,0 +1,72 @@
#include "stdafx.h"
using namespace Win;
LRESULT CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
LRESULT CALLBACK CustomDlg(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
int wmId, wmEvent;
INT_PTR size;
static Win::CWndCtrl Control(hWnd);
LONG h_InstL = GetWindowLong(hWnd, GWL_HINSTANCE);
HINSTANCE hInst = reinterpret_cast<HINSTANCE>(h_InstL);
switch (message)
{
case WM_CREATE:
Control.OnCreate();
case WM_COMMAND:
wmId = LOWORD(wParam);
wmEvent = HIWORD(wParam);
// Parse the menu selections:
switch (wmId)
{
case IDM_ABOUT:
DialogBox(hInst, (LPCTSTR)IDD_ABOUTBOX, hWnd, (DLGPROC)About);
break;
case ID_BRUSHSIZE_THIN:
Control.UpdatePen(1);
break;
case ID_BRUSHSIZE_THICK:
Control.UpdatePen(10);
break;
case ID_BRUSHSIZE_CUSTOM:
size = DialogBox(hInst, (LPCTSTR)IDD_PROPPAGE_SMALL, hWnd, (DLGPROC)CustomDlg);
Control.UpdatePen(static_cast<int>(size));
break;
case IDM_EXIT:
DestroyWindow(hWnd);
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
break;
case WM_LBUTTONDOWN:
Control.OnLButtonDown(lParam);
break;
case WM_MOUSEMOVE:
Control.OnMouseMove(lParam);
break;
case WM_LBUTTONUP:
Control.OnLButtonUp();
break;
case WM_PAINT:
Control.OnPaint();
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
return 0;
}

View File

@ -0,0 +1,64 @@
#include "stdafx.h"
using namespace Win;
Maker::Maker(char const * className,
HINSTANCE hInstance) :
m_hInst(hInstance),
m_ClassName(className),
m_Style(0),
m_x(50),
m_y(50),
m_width(CW_USEDEFAULT),
m_height(CW_USEDEFAULT),
m_pWnd(0),
m_hMenu(0),
m_data(0)
{
}
Maker::Maker(char const * className,
int x, int y, int width, int height,
HWND hPwin,
HMENU hMen,
HINSTANCE hInstance) :
m_hInst(hInstance),
m_ClassName(className),
m_Style(NULL),
m_x(x),
m_y(y),
m_width(width),
m_height(height),
m_pWnd(hPwin),
m_hMenu(hMen),
m_data(NULL)
{
}
void Maker::Create(char * Title, DWORD style)
{
m_hWnd = CreateWindow(
m_ClassName,
Title,
style,
m_x,
m_y,
m_width,
m_height,
m_pWnd,
m_hMenu,
m_hInst,
0 );
if (m_hWnd == 0)
//throw("Internal Error! Creation Failed.");
MessageBox(m_hWnd, "hsdv", "s", MB_OK);
}
void Maker::Show()
{
::ShowWindow(m_hWnd, SW_SHOW);
::UpdateWindow(m_hWnd);
}

View File

@ -0,0 +1,46 @@
#if _MSC_VER > 1000
#pragma once
#endif
#ifndef _WNDMAKER_H_6C085702_C1FF_4965_9588_D0EE8DCD5FC6
#define _WNDMAKER_H_6C085702_C1FF_4965_9588_D0EE8DCD5FC6
namespace Win
{
class Maker
{
public:
Maker(char const * className,
HINSTANCE hInst);
Maker(char const * className,
int x, int y, int width, int height,
HWND hPwin,
HMENU hMen,
HINSTANCE hInst);
void Create(char * Title, DWORD);
void Show();
HINSTANCE GetInstance() {return m_hInst;}
HWND GetWndHandle() {return m_hWnd;}
private :
HINSTANCE m_hInst;
char const* m_ClassName;
DWORD m_Style;
int m_x;
int m_y;
int m_width;
int m_height;
HWND m_pWnd;
HMENU m_hMenu;
void * m_data;
Maker() : m_hWnd(0) {}
protected :
HWND m_hWnd;
};
};
#endif

View File

@ -0,0 +1,20 @@
#include "stdafx.h"
using namespace Win;
Class::Class(WNDPROC winProc, char const * className,
HINSTANCE hInst)
{
m_class.cbSize = sizeof(WNDCLASSEX);
m_class.style = CS_HREDRAW | CS_VREDRAW;
m_class.lpfnWndProc = winProc;
m_class.cbClsExtra = 0;
m_class.cbWndExtra = 0;
m_class.hInstance = hInst;
m_class.hIcon = LoadIcon(hInst, (LPCTSTR)IDI_CRTANJEOOP);
m_class.hCursor = LoadCursor(NULL, IDC_ARROW);
m_class.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
m_class.lpszMenuName = (LPCTSTR)IDC_CRTANJEOOP;
m_class.lpszClassName = className;
m_class.hIconSm = LoadIcon(m_class.hInstance, (LPCTSTR)IDI_SMALL);
}

View File

@ -0,0 +1,21 @@
#if _MSC_VER > 1000
#pragma once
#endif
#ifndef _WNDCLASS_6DBD5B8E_C130_4e01_80DD_0ECB5B894D54
#define _WNDCLASS_6DBD5B8E_C130_4e01_80DD_0ECB5B894D54
namespace Win
{
class Class
{
public :
Class(WNDPROC winProc, char const * className, HINSTANCE hInst);
void Register() { ::RegisterClassEx(& m_class); }
private :
WNDCLASSEX m_class;
};
};
#endif

View File

@ -0,0 +1,125 @@
#include "stdafx.h"
using namespace Win;
VOID CALLBACK TimerProc(HWND, UINT, UINT, DWORD);
void CWndCtrl::OnCreate()
{
CDtClock dtClock;
SetTimer(m_hWnd, ID_TIMER, dtClock.GetInterval(), TimerProc) ;
}
void CWndCtrl::OnLButtonDown(const LPARAM lParam)
{
POINTS pt = MAKEPOINTS(lParam);
RECT rect;
GetClientRect(m_hWnd, &rect);
if (pt.y >= rect.bottom - 50 && pt.y < rect.bottom - 10 &&
pt.x >= rect.left + 10 && pt.x < rect.left + 110)
{
m_ClrRef = GetColor(pt);
UpdatePen(m_ClrRef);
}
else
{
m_pressed = true;
SetCapture(m_hWnd);
m_lnDraw.SetBegin(lParam);
m_lnDraw.SetEnd();
m_lnDraw.DrawLine(m_hWnd);
}
}
void CWndCtrl::OnMouseMove(const LPARAM lParam)
{
DrawMousePos(lParam);
if (m_pressed)
{
m_lnDraw.SetEnd();
m_lnDraw.SetBegin(lParam);
m_lnDraw.DrawLine(m_hWnd);
}
}
void CWndCtrl::OnLButtonUp()
{
m_pressed = false;
ReleaseCapture();
}
void CWndCtrl::OnPaint()
{
PAINTSTRUCT ps;
HDC hdc = BeginPaint(m_hWnd, &ps);
EndPaint(m_hWnd, &ps);
}
void CWndCtrl::UpdatePen(COLORREF ClrRef)
{
m_ClrRef = ClrRef;
HPEN hPen = CreatePen(PS_SOLID, m_size, m_ClrRef);
m_lnDraw.UpdatePen(hPen);
}
void CWndCtrl::UpdatePen(int Size)
{
m_size = Size;
HPEN hPen = CreatePen(PS_SOLID, m_size, m_ClrRef);
m_lnDraw.UpdatePen(hPen);
}
void CWndCtrl::DrawMousePos(LPARAM lParam)
{
POINTS point = MAKEPOINTS(lParam);
char krd[30];
HBRUSH hBrush = CreateSolidBrush(RGB(0, 0, 0));
RECT rect;
HDC hdc = GetDC(m_hWnd);
GetClientRect(m_hWnd, &rect);
sprintf(krd, "x : %d | y : %d", point.x, point.y);
int len = static_cast<int>(strlen(krd));
SelectObject(hdc, hBrush);
Rectangle(hdc, 0, 17, 110, 0);
SetBkColor(hdc, BLACK_BRUSH);
SetTextColor(hdc, RGB(255, 255, 255));
DrawText(hdc, krd, len, &rect, 0);
DeleteObject(hBrush);
ReleaseDC(m_hWnd, hdc);
}
COLORREF CWndCtrl::GetColor(POINTS pt) const
{
RECT rc;
GetClientRect(m_hWnd, &rc);
COLORREF ClrRef = RGB(0, 0, 0);
if (pt.y >= rc.bottom - 50 && pt.y < rc.bottom - 30)
{
if (pt.x >= rc.left + 30 && pt.x < rc.left + 50)
ClrRef = RGB(255, 0, 0);
else if (pt.x >= rc.left + 50 && pt.x < rc.left + 70)
ClrRef = RGB(255, 255, 0);
else if (pt.x >= rc.left + 70 && pt.x < rc.left + 90)
ClrRef = RGB(0, 255, 0);
else if (pt.x >= rc.left + 90 && pt.x < rc.left + 110)
ClrRef = RGB(0, 0, 255);
}
else if (pt.y >= rc.bottom - 30)
{
if (pt.x >= rc.left + 10 && pt.x < rc.left + 30)
ClrRef = RGB(255, 255, 255);
else if (pt.x >= rc.left + 30 && pt.x < rc.left + 50)
ClrRef = RGB(255, 0, 255);
else if (pt.x >= rc.left + 50 && pt.x < rc.left + 70)
ClrRef = RGB(255, 150, 0);
else if (pt.x >= rc.left + 70 && pt.x < rc.left + 90)
ClrRef = RGB(0, 255, 255);
else if (pt.x >= rc.left + 90 && pt.x < rc.left + 110)
ClrRef = RGB(150, 0, 255);
}
return ClrRef;
}

View File

@ -0,0 +1,41 @@
#if _MSC_VER > 1000
#pragma once
#endif
#ifndef _WNDCONTROL_H_3895179F_857F_4626_9902_A8A5362317C1
#define _WNDCONTROL_H_3895179F_857F_4626_9902_A8A5362317C1
#include "stdafx.h"
namespace Win
{
class CWndCtrl
{
public:
CWndCtrl(HWND hWnd) : m_hWnd(hWnd), m_lnDraw(), /*m_sl(),*/ m_pressed(false),
m_ClrRef(RGB(0,0,0)), m_size(1) {}
void OnCreate();
void OnLButtonDown(const LPARAM lParam);
void OnMouseMove(const LPARAM lParam);
void OnLButtonUp();
void OnPaint();
void UpdatePen(int);
void UpdatePen(COLORREF);
private:
COLORREF GetColor(POINTS) const;
void DrawMousePos(LPARAM);
HWND m_hWnd;
CLineDrawer m_lnDraw;
// CSaveLine m_sl[10000];
bool m_pressed;
COLORREF m_ClrRef;
int m_size;
};
};
#endif