Skip to content

Commit

Permalink
Merge pull request #36 from bgrabitmap/dev-bgracontrols
Browse files Browse the repository at this point in the history
Dev bgracontrols
  • Loading branch information
lainz committed Dec 6, 2018
2 parents 105ca5f + bb3d037 commit 68fb797
Show file tree
Hide file tree
Showing 11 changed files with 194 additions and 11 deletions.
8 changes: 4 additions & 4 deletions bcmdbutton.pas
Expand Up @@ -22,18 +22,18 @@ interface

var
// Default icons for Check Box
BCMDBUTTONBALLOTBOX: string = ''; // '✗'
{BCMDBUTTONBALLOTBOX: string = '☐'; // '✗'
BCMDBUTTONBALLOTBOXWITHCHECK: string = '☑'; // '✓'
// Default icons for Radio Button
BCMDBUTTONRADIOBUTTON: string = '🔘';
BCMDBUTTONRADIOBUTTONCIRCLE: string = '';
BCMDBUTTONRADIOBUTTONCIRCLE: string = '◯';}

// Characters that can be used on systems that lack of the previous unicode symbols
{BCMDBUTTONBALLOTBOX: string = '[ ]';
BCMDBUTTONBALLOTBOX: string = '[ ]';
BCMDBUTTONBALLOTBOXWITHCHECK: string = '[X]';
BCMDBUTTONRADIOBUTTON: string = '[O]';
BCMDBUTTONRADIOBUTTONCIRCLE: string = '[ ]';}
BCMDBUTTONRADIOBUTTONCIRCLE: string = '[ ]';

// Animation speed
// Possible values: between 0 and 1
Expand Down
2 changes: 1 addition & 1 deletion bgracontrols.lpk
Expand Up @@ -33,7 +33,7 @@
</CompilerOptions>
<Description Value="BGRA Controls is a set of graphical UI elements that you can use with Lazarus LCL applications."/>
<License Value="Modified LGPL"/>
<Version Major="6"/>
<Version Major="6" Release="2"/>
<Files Count="47">
<Item1>
<Filename Value="bcbasectrls.pas"/>
Expand Down
4 changes: 2 additions & 2 deletions bgracontrols.stat
Expand Up @@ -2,8 +2,8 @@
EditorSecs=106
DesignerSecs=1
InspectorSecs=16
CompileSecs=29377
OtherSecs=378
CompileSecs=36721
OtherSecs=393
StartTime=30/11/2018 11:43:57
RealKeys=0
EffectiveKeys=0
Expand Down
8 changes: 6 additions & 2 deletions materialcolors.pas
Expand Up @@ -19,7 +19,7 @@
interface

uses
Classes, SysUtils, BGRABitmap, BGRABitmapTypes, Generics.Collections;
Classes, SysUtils, BGRABitmap, BGRABitmapTypes, {$IFDEF FPC}FGL{$ELSE}Generics.Collections{$ENDIF};

type

Expand All @@ -44,7 +44,11 @@ TMaterialColors = record
aM700, aM800, aM900, aA100, aA200, aA400, aA700: string);
end;

TMaterialColorsList = {specialize} TDictionary<string, TMaterialColors>;
{$IFDEF FPC}
TMaterialColorsList = TFPGMap<string, TMaterialColors>;
{$ELSE}
TMaterialColorsList = TDictionary<string, TMaterialColors>;
{$ENDIF}

procedure MaterialColorsListStr(AList: TStrings);

Expand Down
Binary file added test/test_bcimagebutton_toggle/test.ico
Binary file not shown.
84 changes: 84 additions & 0 deletions test/test_bcimagebutton_toggle/test.lpi
@@ -0,0 +1,84 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<General>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="test"/>
<Scaled Value="True"/>
<ResourceType Value="res"/>
<UseXPManifest Value="True"/>
<XPManifest>
<DpiAware Value="True"/>
</XPManifest>
<Icon Value="0"/>
<Resources Count="1">
<Resource_0 FileName="toggle.png" Type="RCDATA" ResourceName="TOGGLE"/>
</Resources>
</General>
<BuildModes Count="1">
<Item1 Name="Default" Default="True"/>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
<UseFileFilters Value="True"/>
</PublishOptions>
<RunParams>
<FormatVersion Value="2"/>
<Modes Count="0"/>
</RunParams>
<RequiredPackages Count="2">
<Item1>
<PackageName Value="bgracontrols"/>
</Item1>
<Item2>
<PackageName Value="LCL"/>
</Item2>
</RequiredPackages>
<Units Count="2">
<Unit0>
<Filename Value="test.lpr"/>
<IsPartOfProject Value="True"/>
</Unit0>
<Unit1>
<Filename Value="umain.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="Form1"/>
<ResourceBaseClass Value="Form"/>
</Unit1>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="test"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Linking>
<Options>
<Win32>
<GraphicApplication Value="True"/>
</Win32>
</Options>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>
22 changes: 22 additions & 0 deletions test/test_bcimagebutton_toggle/test.lpr
@@ -0,0 +1,22 @@
program test;

{$mode objfpc}{$H+}

uses
{$IFDEF UNIX}{$IFDEF UseCThreads}
cthreads,
{$ENDIF}{$ENDIF}
Interfaces, // this includes the LCL widgetset
Forms, umain
{ you can add units after this };

{$R *.res}

begin
RequireDerivedFormResource:=True;
Application.Scaled:=True;
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.

Binary file added test/test_bcimagebutton_toggle/toggle.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions test/test_bcimagebutton_toggle/umain.lfm
@@ -0,0 +1,33 @@
object Form1: TForm1
Left = 374
Height = 240
Top = 149
Width = 320
Caption = 'Toggle'
ClientHeight = 240
ClientWidth = 320
OnCreate = FormCreate
LCLVersion = '2.1.0.0'
object BCImageButton1: TBCImageButton
Cursor = crHandPoint
Left = 15
Height = 28
Top = 15
Width = 57
AlphaTest = False
BitmapFile = 'TOGGLE'
BitmapOptions.Direction = sdVertical
Toggle = True
end
object BCImageButton2: TBCImageButton
Cursor = crHandPoint
Left = 15
Height = 52
Top = 56
Width = 100
AlphaTest = False
BitmapFile = 'TOGGLE'
BitmapOptions.Direction = sdVertical
Toggle = True
end
end
40 changes: 40 additions & 0 deletions test/test_bcimagebutton_toggle/umain.pas
@@ -0,0 +1,40 @@
unit umain;

{$mode objfpc}{$H+}

interface

uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, BCImageButton;

type

{ TForm1 }

TForm1 = class(TForm)
BCImageButton1: TBCImageButton;
BCImageButton2: TBCImageButton;
procedure FormCreate(Sender: TObject);
private

public

end;

var
Form1: TForm1;

implementation

{$R *.lfm}

{ TForm1 }

procedure TForm1.FormCreate(Sender: TObject);
begin
BCImageButton1.LoadFromBitmapResource(BCImageButton1.BitmapFile);
BCImageButton2.LoadFromBitmapResource(BCImageButton2.BitmapFile);
end;

end.

4 changes: 2 additions & 2 deletions update_bgracontrols_force.json
Expand Up @@ -6,9 +6,9 @@
"UpdatePackageFiles" : [
{
"ForceNotify" : true,
"InternalVersion" : 19,
"InternalVersion" : 20,
"Name" : "bgracontrols.lpk",
"Version" : "6.0.0.0"
"Version" : "6.0.2.0"
},
{
"ForceNotify" : false,
Expand Down

0 comments on commit 68fb797

Please sign in to comment.