Skip to content

Commit

Permalink
project
Browse files Browse the repository at this point in the history
  • Loading branch information
miljanasimic committed Mar 11, 2022
1 parent 1b28b64 commit 6a7cc9c
Show file tree
Hide file tree
Showing 193 changed files with 44,467 additions and 0 deletions.
25 changes: 25 additions & 0 deletions Desktop app/TaksiUdruzenje.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30711.63
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TaksiUdruzenje", "TaksiUdruzenje\TaksiUdruzenje.csproj", "{7B336875-2DC5-4E09-B06E-AEDFEDDFD224}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7B336875-2DC5-4E09-B06E-AEDFEDDFD224}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7B336875-2DC5-4E09-B06E-AEDFEDDFD224}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7B336875-2DC5-4E09-B06E-AEDFEDDFD224}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7B336875-2DC5-4E09-B06E-AEDFEDDFD224}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {928458D0-55BF-41B4-BC4D-9FC1F9902AA8}
EndGlobalSection
EndGlobal
34 changes: 34 additions & 0 deletions Desktop app/TaksiUdruzenje/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="oracle.manageddataaccess.client"
type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.122.19.1, Culture=neutral, PublicKeyToken=89b483f429c47342"/>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/>
</startup>
<system.data>
<DbProviderFactories>
<remove invariant="Oracle.ManagedDataAccess.Client"/>
<add name="ODP.NET, Managed Driver" invariant="Oracle.ManagedDataAccess.Client" description="Oracle Data Provider for .NET, Managed Driver"
type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.122.19.1, Culture=neutral, PublicKeyToken=89b483f429c47342"/>
</DbProviderFactories>
</system.data>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<publisherPolicy apply="no"/>
<assemblyIdentity name="Oracle.ManagedDataAccess" publicKeyToken="89b483f429c47342" culture="neutral"/>
<bindingRedirect oldVersion="4.121.0.0 - 4.65535.65535.65535" newVersion="4.122.19.1"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
<oracle.manageddataaccess.client>
<version number="*">
<dataSources>
<dataSource alias="SampleDataSource"
descriptor="(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ORCL))) "/>
</dataSources>
</version>
</oracle.manageddataaccess.client>
</configuration>
292 changes: 292 additions & 0 deletions Desktop app/TaksiUdruzenje/BorderLabel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,292 @@
/***********************************************************************
* BorderLabel.cs - Simple Label Control with Border Effect *
* *
* Author: César Roberto de Souza *
* Email: cesarsouza at gmail.com *
* Website: http://www.comp.ufscar.br/~cesarsouza *
* *
* This code is distributed under the The Code Project Open License *
* (CPOL) 1.02 or any later versions of this same license. By using *
* this code you agree not to remove any of the original copyright, *
* patent, trademark, and attribution notices and associated *
* disclaimers that may appear in the Source Code or Executable Files *
* *
* The exact terms of this license can be found on The Code Project *
* website: http://www.codeproject.com/info/cpol10.aspx *
* *
***********************************************************************/


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Data;
using System.Text;
using System.Windows.Forms;


namespace cSouza.WinForms.Controls
{

/// <summary>
/// Represents a Bordered label.
/// </summary>
public partial class BorderLabel : Label
{
private float borderSize;
private Color borderColor;

private PointF point;
private SizeF drawSize;
private Pen drawPen;
private GraphicsPath drawPath;
private SolidBrush forecolorBrush;



// Constructor
//-----------------------------------------------------

#region Constructor
/// <summary>
/// Constructs a new BorderLabel object.
/// </summary>
public BorderLabel()
{
this.borderSize = 1f;
this.borderColor = Color.White;
this.drawPath = new GraphicsPath();
this.drawPen = new Pen(new SolidBrush(this.borderColor), borderSize);
this.forecolorBrush = new SolidBrush(this.ForeColor);

this.Invalidate();
}
#endregion



// Public Properties
//-----------------------------------------------------

#region Public Properties

/// <summary>
/// The border's thickness
/// </summary>
[Browsable(true)]
[Category("Appearance")]
[Description("The border's thickness")]
[DefaultValue(1f)]
public float BorderSize
{
get { return this.borderSize; }
set
{
this.borderSize = value;
if (value == 0)
{
//If border size equals zero, disable the
// border by setting it as transparent
this.drawPen.Color = Color.Transparent;
}
else
{
this.drawPen.Color = this.BorderColor;
this.drawPen.Width = value;
}

this.OnTextChanged(EventArgs.Empty);
}
}


/// <summary>
/// The border color of this component
/// </summary>
[Browsable(true)]
[Category("Appearance")]
[DefaultValue(typeof(Color), "White")]
[Description("The border color of this component")]
public Color BorderColor
{
get { return this.borderColor; }
set
{
this.borderColor = value;

if (this.BorderSize != 0)
this.drawPen.Color = value;

this.Invalidate();
}
}

#endregion



// Public Methods
//-----------------------------------------------------

#region Public Methods
/// <summary>
/// Releases all resources used by this control
/// </summary>
/// <param name="disposing">True to release both managed and unmanaged resources.</param>
protected override void Dispose(bool disposing)
{
if (disposing)
{

if (this.forecolorBrush != null)
this.forecolorBrush.Dispose();

if (this.drawPath != null)
this.drawPath.Dispose();

if (this.drawPen != null)
this.drawPen.Dispose();

}
base.Dispose(disposing);
}
#endregion



// Event Handling
//-----------------------------------------------------

#region Event Handling
protected override void OnFontChanged(EventArgs e)
{
base.OnFontChanged(e);
this.Invalidate();
}

protected override void OnTextAlignChanged(EventArgs e)
{
base.OnTextAlignChanged(e);
this.Invalidate();
}

protected override void OnTextChanged(EventArgs e)
{
base.OnTextChanged(e);
}

protected override void OnForeColorChanged(EventArgs e)
{
this.forecolorBrush.Color = base.ForeColor;
base.OnForeColorChanged(e);
this.Invalidate();
}
#endregion



// Drawning Events
//-----------------------------------------------------

#region Drawning
protected override void OnPaint(PaintEventArgs e)
{

// First lets check if we indeed have text to draw.
// if we have no text, then we have nothing to do.
if (this.Text.Length == 0)
return;


// Secondly, lets begin setting the smoothing mode to AntiAlias, to
// reduce image sharpening and compositing quality to HighQuality,
// to improve our drawnings and produce a better looking image.

e.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
e.Graphics.CompositingQuality = CompositingQuality.HighQuality;



// Next, we measure how much space our drawning will use on the control.
// this is important so we can determine the correct position for our text.
this.drawSize = e.Graphics.MeasureString(this.Text, this.Font, new PointF(), StringFormat.GenericTypographic);



// Now, we can determine how we should align our text in the control
// area, both horizontally and vertically. If the control is set to auto
// size itselft, then it should be automatically drawn to the standard position.

if (this.AutoSize)
{
this.point.X = this.Padding.Left;
this.point.Y = this.Padding.Top;
}
else
{
// Text is Left-Aligned:
if (this.TextAlign == ContentAlignment.TopLeft ||
this.TextAlign == ContentAlignment.MiddleLeft ||
this.TextAlign == ContentAlignment.BottomLeft)
this.point.X = this.Padding.Left;

// Text is Center-Aligned
else if (this.TextAlign == ContentAlignment.TopCenter ||
this.TextAlign == ContentAlignment.MiddleCenter ||
this.TextAlign == ContentAlignment.BottomCenter)
point.X = (this.Width - this.drawSize.Width) / 2;

// Text is Right-Aligned
else point.X = this.Width - (this.Padding.Right + this.drawSize.Width);


// Text is Top-Aligned
if (this.TextAlign == ContentAlignment.TopLeft ||
this.TextAlign == ContentAlignment.TopCenter ||
this.TextAlign == ContentAlignment.TopRight)
point.Y = this.Padding.Top;

// Text is Middle-Aligned
else if (this.TextAlign == ContentAlignment.MiddleLeft ||
this.TextAlign == ContentAlignment.MiddleCenter ||
this.TextAlign == ContentAlignment.MiddleRight)
point.Y = (this.Height - this.drawSize.Height) / 2;

// Text is Bottom-Aligned
else point.Y = this.Height - (this.Padding.Bottom + this.drawSize.Height);
}



// Now we can draw our text to a graphics path.
//
// PS: this is a tricky part: AddString() expects float emSize in pixel, but Font.Size
// measures it as points. So, we need to convert between points and pixels, which in
// turn requires detailed knowledge of the DPI of the device we are drawing on.
//
// The solution was to get the last value returned by the Graphics.DpiY property and
// divide by 72, since point is 1/72 of an inch, no matter on what device we draw.
//
// The source of this solution can be seen on CodeProject's article
// 'OSD window with animation effect' - http://www.codeproject.com/csharp/OSDwindow.asp

float fontSize = e.Graphics.DpiY * this.Font.SizeInPoints / 72;

this.drawPath.Reset();
this.drawPath.AddString(this.Text, this.Font.FontFamily, (int)this.Font.Style, fontSize,
point, StringFormat.GenericTypographic);


// And finally, using our pen, all we have to do now
// is draw our graphics path to the screen. Voilla!
e.Graphics.FillPath(this.forecolorBrush, this.drawPath);
e.Graphics.DrawPath(this.drawPen, this.drawPath);

}
#endregion


}
}
Loading

0 comments on commit 6a7cc9c

Please sign in to comment.