Giter Club home page Giter Club logo

bgracontrols's Introduction

List of directories:

  • bglcontrols: controls providing OpenGL surface with BGRABitmap
  • bgrabitmap: contains BGRABitmap library
  • dev: tools used to make BGRABitmap
  • doc: scripts to generate html documentation (uses pasdoc and graphviz)
  • libwebp: contains the Dll of LibWebP for Windows
  • test: contains a series of test programs and examples on how to use BGRABitmap library
  • winmake: contains batch files for make under Windows

Files:

  • commit.sh: script to commit change from Linux terminal
  • Makefile: generate the code and compile. On Windows, you need to make sure that make.exe from FPC and lazutils.exe from Lazarus tools are in the PATH.
  • update_BGRABitmap.json: package information for OPM in Lazarus

Useful binaries for Windows:

BGRA Controls

bgracontrols's People

Contributors

bobanspasic avatar circular17 avatar dalfy15 avatar lainz avatar maxm74 avatar omegaxhunter avatar paweld avatar phoenixfenix avatar sganz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bgracontrols's Issues

SVG GUI

What about an entire UI made with SVG? I'm looking for ideas.

Say we have just resources and we forget about the complex properties system we have now. Anything you can draw with SVG can be drawn on screen at any scale factor.

If you want other style just change the SVG images. That's what we do on Android Studio apps.

Like we currently have for svg button in bgracontrols.

I think the missing part will be 9 slice scaling for SVG. So we can create scalable rectangles. Most vectors app has this stuff. Where you can define a smart rectangle object with rounded borders. If you scale it the borders rounded ratio remains the same for the corners.

I think with that we can do any UI. Of course we can have properties, but these can be less. Themes can use different images so no need to define gradients, line thickness, rounding and so on... change the images and you change the entire app look.

As well is easier because you can hire a designer that can do all the svg files for you.

How it is done on android? The answer is XML. I think that I've seen XML as well on Visual Studio apps for Windows 10.

Not sure if this is reinventing the wheel but the LCL looks really old stuff even with BGRAControls.

Maybe we can have LCL controls in the Lazarus IDE but all SVG and nothing more.

I opened this bug report because I've used the svg viewer of bgracontrols and get amazed. It scales well even if I change the windows dpi when the app is running. The imagelist trick didn't work in that case... I need to close and open lazpaint again to see the effect.

Well that's it. It sounds hard but I think I will start another package only with svg controls. And this time I will not quit soon, even if I don't see the results immediately.

I will try to learn more about how android studio does it because we have really nice looking apps made with that and i want that for Lazarus desktop. Tired of Electron .js I must say.

bcpaperlistbox.rc

Hello!

When you compile bclistbox.pas under Linux, an error occurs:
Error: resource compiler "windres.exe" not found, switching to external mode
This is because Linux does not have any .exe...
I avoided this problem in this way:
Compiled the package in the Windows environment. I got the file ..\bgracontrols-master\lib\x86_64-win64\3.0.2\bcpaperlistbox.res which I then copied into the ..\bgracontrols-master\bcpaperlistbox.res and in the file ..\bgracontrols-master\bclistbox.pas replaced {$R bcpaperlistbox.rc} to {$R bcpaperlistbox.res}

I think this is better to fix via {$I bcpaperlistbox.lrs}

Lazarus 1.6.4 Win64/Linux Fedora 25 64-bit

Thanks!

BCMDButton improvements

Hello Lainz,

I did some modifications to the original BCMDButtons.pas file.
For example, I implemented the feature to specify the color of a checked TabButton and the feature to specify the position of the colored check mark of an checked TabButton.
See the screenshot of my test-file here: https://www.screencast.com/t/aRIXUtnB

I am not familar with GitHub, pull-requests and so on.
Are you willing to put my modifications to the offical source code?

Attached you will find my bcmdbutton.pas file and a ZIP Archive with the test-project

Fritz

Source: https://forum.lazarus.freepascal.org/index.php/topic,24176.msg373870.html#msg373870

Files:
mdbutton_tab_test.zip
bcmdbutton.zip

Question about RadialProgressBar

Hi. I love your controls. Thanks for all the hard work.
I would love to use the Radial Progress bar as a Guage. Is there a way to remove the % and have the real value and not change it to a value between 0 and 100?

Add Glyph support in Buttons

The buttons that currently doesn't have glyph: TBCImageButton, TBCMDButton, TBCMaterialDesignButton.

Adding glyph to the other buttons doesn't have sense, but it can be discussed.

License headers

To be able to include files in a Debian package, it is recommended that each file would have a header specifying the license, and that the full text of the license be provided as a separate file. This would probably be required if we hope adding our applications to Debian distributions.

In the case of opensource Lazarus packages, it is the modified LGPL license.

So in each code file, except bgracontrols.pas which is generated, I suggest to add:
// SPDX-License-Identifier: LGPL-3.0-only (modified to allow linking)
That's more or less the syntax used in Inkscape code files. Note that the (modified to allow linking) text is not part of this protocol, but would probably be ignored by an automatic parser. Anyway, the modified linking is only relevant for Lazarus when we link libraries.

And in the base directory, add the files COPYING.LGPL.txt and COPYING.modifiedLGPL.txt.
COPYING.LGPL.txt
COPYING.modifiedLGPL.txt

I can do the change though I would like to have another opinion about it.

Got a question...TBCButton in control

Im using a TBCButton in a component.
Everything works fine, but if I wanna assignstyle using AssignFromFile i goes to hell everything.
dont know if ist because the path. but i check that
exist:=FileExists('../styles/google-menu.bcbtn') //Exists is true
and then:
buton_1.AssignFromFile('../styles/google-menu.bcbtn');
and Its so awfull that IDE hangs and closes.
Is there something im missing?
regards

Hi Lainz...SO there is no way to assignstyle...

Hi LAinz,
First of all, even if not said anything before.., the package is awesome. Great loocking.

One last question, please.
There is no way to load a style if not in graphical mode in IDE.
I mean, i wanna use a TBCButton within a component so no graphical interface.
Something like:

buton_1:=TBCButton.create(self);
buton_1.Parent:=self;
buton_1.Width:=25;
buton_1.ShowCaption:=false;
buton_1.DropDownArrowSize:=18;
buton_1.DropDownWidth:=25;
buton_1.DropDownArrow:=true;

.....
But cant find how to assign style....
Hope can gimme a tip on in.

Regards

Image panel

Like BCPaperPanel with an option to select the background image and the margins.

TBCComboBox anchors?

anch

TBCComboBox combobox anchors how fix?

TBCComboBox doesn't have Lazarus anchors alignment feature How to fix or update later?

Error on null selected cropped area

When I select a null cropped area, by only click and release mouse button on image (no drag it), there is an error.

... exception 'External SIGSEGV'
... on file 'braimagemanipulation.pas' line 2552;
if (rSelectedCropArea.Area.Left > rSelectedCropArea.Area.Right) then

I think that the problem is some lines earlier.

at line 2544..
begin
// Ends a new selection of cropping area
if (rNewCropArea <> Nil) then
begin
rSelectedCropArea :=rNewCropArea;
rNewCropArea :=Nil;
end;

  if (rSelectedCropArea.Area.Left > rSelectedCropArea.Area.Right) then
  begin
    // Swap left and right coordinates
    temp := rSelectedCropArea.Area.Left;
    rSelectedCropArea.Area.Left := rSelectedCropArea.Area.Right;
    rSelectedCropArea.Area.Right := temp;
  end;       

Ok, If rNewCropArea is not null the code knows the how to deal, but, If the rNewCropArea IS null, the code does the same, then there are not iniciallized values...

Thanks

BGRAGraphicControl turns transparent onredraw

Hi,

I've got an issue with the with the TBGRAGraphicControl component. When I reposition for example a button on the form from within the onredraw, the canvas turns transparent for a moment, before painting it. This does not happen with the TBGRAVirtualScreen. This is the test code I use:

procedure TForm1.FormCreate(Sender: TObject);
begin
  with BGRAGraphicControl1
  do begin
    Align:=alLeft;
    BevelOuter := bvNone;
    Color := clYellow;
    ColorOpacity:=255;
    Caption := '';
  end;

  with BGRAVirtualScreen1
  do begin
    Align:=alRight;
    Caption := '';
  end;
end;
procedure TForm1.FormResize(Sender: TObject);
begin
  BGRAGraphicControl1.Width := (Form1.Width div 2);
  BGRAVirtualScreen1.Width := Form1.Width - BGRAGraphicControl1.Width-10;
end;
procedure TForm1.BGRAGraphicControl1Redraw(Sender: TObject; Bitmap: TBGRABitmap);
begin
  Bitmap.FillRect(0, 0, Bitmap.Width, Bitmap.Height, clLime);
  sleep(10); // To make it a little bit more visible
  Button1.Left := (Form1.Width div 2); // <--- enable this and the screen flickers
end;
procedure TForm1.BGRAVirtualScreen1Redraw(Sender: TObject; Bitmap: TBGRABitmap);
begin
  Bitmap.FillRect(0, 0, Bitmap.Width, Bitmap.Height, clRed);
  sleep(10); // To make it a little bit more visible
  //Button1.Left := (Form1.Width div 2); // <--- enable this and the screen won't flicker  (and disable the above)
end; 

Is this fixable? I've looked into the onredraw source, but can't find a problem there.

Best regards, Maarten

TBCButton does not honor LineEnding in Caption

With fpc-3.0.2, lazarus 2.0.10, bgrabitmap 11.2.1.0 and bgracontrols 6.8.0 TBCButton have a small issue.
If the Caption contain LineEnding this is not respected, text is render on a single line. Word wrapping is working.
Example:
BCButton1.Caption:='Row1' + LineEnding + 'Row2'
the result is:
Row1Row2
Expected result:
Row1
Row2

Thank you!

Fresh install fails on fresh install of Lazarus 2.0.10

Compiling fails with the message:
bcimagebutton.pas(30,32) Fatal: Cannot find BGRASliceScaling used by BCImageButton, incompatible ppu=C:\Users...\packages\bgrabitmap-11.1\bgrabitmap\lib\x86_64-win64\3.2.0\bgraslicescaling.ppu, package BGRABitmapPack

Add GroupIndex in Buttons Controls

I'm porting my software from Delphi to Lazarus and considering that CindyComps in Lazarus has poor performance and issues, I want using BGRA Controls. Precisely I'm using TBCImageButton, but I miss a property like GroupIndex. With this property, I can use TBCImageButton as tab controls. So I have only one button in pressed state and others "up" state.

Compiling on linux mint with Lazarus 1.8.0RC3

Hello,

I am trying to compile bgracontrols or bgrabitmaps into lazarus 1.8.0rc3.
But compiler giving some error messages:

Δ°letiler, Warnings: 1
Warning: other sources path of package "lnetbase 0.6.6" contains directory "../lib", which is already in the unit search path.
Build IDE: Exit code 512, Errors: 1
[lazarus] Error 1
[idepkg] Error 2
make: *** [idepkg] Error 2
lazarus.pp(161,1) Error: Error while linking

So I also installed windres for linux with by "sudo apt-get install mingw32" but I couldn't success.

What should I do for installing?

Unable to rebuild IDE with bgracontrols on Linux

Unable to rebuild IDE with BragControls on Linux
Debian 8 32 bits, Debian 9 x64 and Fedora 27 x64

Lazarus 1.8.0
FPC 3.0.4
from sourceforges
All other packages build fine but trying to install bgracontrols building IDE fail with

[Makefile:3961: lazarus] Error 1
[Makefile:4383: idepkg] Error 2
make: *** [Makefile:3261: idepkg] Error 2
lazarus.pp(161,1) Error: Error while linking

No other error are displayed.
After that, removing package bgracontrols in package manager and trying to build IDE always fail
i must remove .lazarus in my home folder and loose all package to rebuild IDE

Version 6.8.0.0 does not compile

Version 6.8.0.0 Does not compile because:

Compile package bgracontrols 6.8: Exit code 1, Errors: 2, Hints: 6
bcbutton.pas(1238,55) Note: Call to subroutine "operator :=(const source:LongInt):Variant;" marked as inline is not inlined
bcbutton.pas(1249,72) Note: Call to subroutine "operator :=(const source:Variant):LongInt;" marked as inline is not inlined
bccombobox.pas(54,62) Hint: Parameter "Shift" not used
bccombobox.pas(65,7) Hint: Parameter "AState" not used
bccombobox.pas(83,30) Hint: Parameter "Message" not used
bccombobox.pas(86,38) Hint: Parameter "Shift" not used
bgravirtualscreen.pas(420,55) Error: Wrong number of parameters specified for call to "DrawPart"
bgragtkbitmap.pas(156,26) Error: Found declaration: DrawPart(TRect;TCanvas;LongInt;LongInt;Boolean);

TBGRAImageList don't work with TImageIndexPropertyEditor

TBGRAImageList don't work with TImageIndexPropertyEditor. When it is used on objects that has this property handling some property, the list is empty, only the first one is painted with one of picture of list.

Only in GKT2. QT is Fine. I don't know the behavior in other systems/platforms.

To reproduce this:

  1. Put a TBGRAimageList on a project and configure it (image size and put some images on Image List)
  2. Then put a TPopupMenu and link it with previous created TBGRAImageList.
  3. Edit the previous created TPopupMenu and Insert a MenuItem
  4. On created MenuItem, look at the property ImageIndex. Click on it and combobox will appear. Look at the Itens

System Color problem

Hello,
using the debugger (FPC 3.0.4 and Lazarus 1.8.4 (Win10) 32bit) with the controls enabled, I detected a "RunError 201" error on ColorToBGRA () when I click to change the value of a BCTrackbarUpdown control.
I think I found the cause:

in TCustomBCTrackbarUpdown.RenderOnBitmap ()

ABitmap.FillRect(x,y+1,x+s.cx,y+s.cy,clHighlight,dmSet);
ABitmap.TextOut(x,y,inSel,clHighlightText);

these lines should be:

ABitmap.FillRect(x,y+1,x+s.cx,y+s.cy,ColorToRGB(clHighlight),dmSet);
ABitmap.TextOut(x,y,inSel,ColorToRGB(clHighlightText));

Thanks

BGRAControls and MSEgui

Hello.

I am trying to convert some BGRABitmap demos using MSEgui widgetset.
Now I am busy with the "fractal_tree" demo.

But it fails to compile with that error:

bgravirtualscreen.pas(48,34) Fatal: Can't find unit LMessages used by BGRAVirtualScreen

Is it possible to use BGRAControls without the LCL LMessages unit (and all other LCL dependencies like graphtypes) ?

Thanks.

Fre;D

TBCComboBox focus and tabstop

Hi, we can implement focusing and tabstop for TBCComboBox, it will cause any problems in LazPaint?

It will be like this:

  • Changing to TBCButtonFocus
  • Drawing a FocusRect in the redraw event
  • Providing a color property for the FocusRect
  • Adding keyboard handling like when pressing the enter key opens the list
  • Pressing the enter key in the list selects and closes the list

Exception with newest BGRABitmap

There is an exception with TBGRABitmapEx bcbasectrls.pas, I can reproduce this sometimes in a form that uses a lot of BCButton.

#0 BGRADEFAULTBITMAP$$TBGRADEFAULTBITMAP$$$DOALPHACORRECTION at :0
#1 BGRAWINBITMAP$
$TBGRAWINBITMAP_$
$$LOADFROMBITMAPIFNEEDED at :0
#2 BGRABITMAPTYPES$
$TCUSTOMUNIVERSALBITMAP_$$$FILL$TUNIVERSALBRUSH$WORD at :0
#3 BGRABITMAPTYPES$
$TGENERICUNIVERSALBITMAP$2$CRC2743D80F_$
$$FILL$TBGRAPIXEL at :0
#4 BCBUTTON$
$TCUSTOMBCBUTTON_$$$RENDER$TBGRABITMAPEX$TBCBUTTONSTATE at :0
#5 BCBUTTON$
$TCUSTOMBCBUTTON_$
$$DRAWCONTROL at :0
#6 BCBASECTRLS$
$TBCGRAPHICCONTROL_$$$PAINT at :0
#7 CONTROLS$
$TGRAPHICCONTROL_$
$$WMPAINT$TLMPAINT at :0
#8 SYSTEM$
$TOBJECT_$$$DISPATCH$formal at :0
#9 ?? at :0
#10 VMT
$CONTROLS_$$TWINCONTROLENUMERATOR$indirect at :0
#11 CONTROLS$
$TGRAPHICCONTROL_$
$$_DESTROY at :0

I will try to reproduce making a demo that shows the bug.

BGRAControls and MSEgui?

Hello!

Now that BGRABitmap is MSEgui compatible, do you think that BGRAControls could work for MSEgui too?

Thanks.

Fre;D

Possible bug in TBCComboBox

Tested today in a form that's show modal, the combobox is used inside that form, the modal is closed. The form is not released. Then the form is used again. On Linux and Mac it fails, it doesn't display the dropdown listbox again.

I think is a problem with ShowModal on these OS. I'm using FPC trunk and Lazarus trunk. That can be part of the problem too.

I add it here to test later.

BGRAGraphicControl performance issue

Hi,

I've got a problem with the performance of the TBGRAGraphicControl. When I do a redraw of the screen it seems to be 5 times slower then the redraw of the TBGRAVirtualScreen. On my computer with the form maximized, the VirtualScreen runs at 50 fps and the GraphicControl only 10 fps.

I've attached a test project to show the performance of both the TBGRAGraphicControl and the TBGRAVirtualScreen. speed_test_bgra_2.zip

I'm probably missing something here, but can't figure out why there's such a difference.

Thanks, Maarten

BCButton cut off in groupbox

Hello,
when I place a TBCButton inside a TGroupBox the Button is cut of at the top. This problem only occurse when I compile my project for my raspberry pi. On Windows everything looks ok.

Example of the problem:

grafik

BGRAVirtualscreen z-order

Hi,

I've got a problem with the BGRAVirtualscreen. I cant change the z-order to move it to the back. It is always on top of other components, for example the TBCButton.

Reproduce:
Place a TBCButton and a BGRAVirtualscreen on the form, and try to send the virtual screen to the back so that the button is visible when you drag it over the virtual screen. (I don't want the virtual screen to be the parent of the button)

I use the github master version of bgracontrols/bgrabitmap and use Lazarus 1.8.0

Best regards,

Maarten

AssignStyle sometimes looks bad?

When assigning the style of a TBCButton with the assign style property, sometimes gradients are horizontal instead of vertical.
Try for example mora.bcbtn, when mouse is over the blue gradient is horizontal instead of vertical.

Can't compile in trunk with BGRABitmap 9.7.4

BCButton line 728
ABGRA.PutImage(l, t, bitmap, dmLinearBlend);

bcbutton.pas(728,34) Error: Incompatible type for arg no. 3: Got "TBitmap", expected "TBGRACustomBitmap"
bgradefaultbitmap.pas(4660,30) Hint: Found declaration: PutImage(LongInt;LongInt;TBGRACustomBitmap;TDrawMode;Byte=255);

RT_RCDATA

bcimagebutton.pas(1393,45) Warning: Symbol "RT_RCDATA" is deprecated: "Use Windows.RT_RCDATA instead"

@circular17 you fixed something similar for BGRABitmap right? How it can be fixed for BGRAControls?

ribbon - increasing memory size after resize

hi,
I have compiled bgracontrols-master\test\BGRA Ribbon Custom\BGRARibbon and run it on windows 10.
Every time I resize the application, I see in taskmanager that the memory size increases.

BCImageButton font problem

Assigning the font color with the Object Inspector doesn't works. Maybe because it needs to call redrawbitmap.

Close problem with Lazarus 1.6.4

example

When you put the Interfaces after the Unit-Forms bgacontrols will cause a crash after you close the Programm(as seen in Picture)

Don't know if this is a problem with your Controls or Lazarus itself. Still thought its worth mentioning,
since i had no clue what caused the Problem.

Putting the Interface before the Unit-Form solves it though.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.