Recent

Author Topic: Ways of making new style design  (Read 14923 times)

aradeonas

  • Hero Member
  • *****
  • Posts: 824
Re: Ways of making new style design
« Reply #15 on: April 20, 2015, 08:50:13 am »
It works good in windows?

circular

  • Hero Member
  • *****
  • Posts: 4196
    • Personal webpage
Re: Ways of making new style design
« Reply #16 on: April 20, 2015, 12:20:44 pm »
What is slow by the way?
Conscience is the debugger of the mind

lainz

  • Hero Member
  • *****
  • Posts: 4460
    • https://lainz.github.io/
Re: Ways of making new style design
« Reply #17 on: April 20, 2015, 12:31:06 pm »
I dont't know exactly if is linux that slowed down my things. Is a panel component but not related with bgrabitmap just using canvas, sure I need to check it out again.

Again, check it out because you do something in one place and can work slow in another!
« Last Edit: April 20, 2015, 12:41:36 pm by 007 »

circular

  • Hero Member
  • *****
  • Posts: 4196
    • Personal webpage
Re: Ways of making new style design
« Reply #18 on: April 20, 2015, 07:52:39 pm »
Hmm.. note that if you use Canvas property of TBGRABitmap, it can be slow.
Conscience is the debugger of the mind

lainz

  • Hero Member
  • *****
  • Posts: 4460
    • https://lainz.github.io/
Re: Ways of making new style design
« Reply #19 on: April 20, 2015, 08:28:14 pm »
Sorry I not explained well, is not related to bgrabitmap. Is related to default canvas.

But I think that was a problem when using the virtual machine, now I have a working linux distro.

circular

  • Hero Member
  • *****
  • Posts: 4196
    • Personal webpage
Re: Ways of making new style design
« Reply #20 on: April 20, 2015, 08:38:16 pm »
Oh ok. So now it is fast?
Conscience is the debugger of the mind

lainz

  • Hero Member
  • *****
  • Posts: 4460
    • https://lainz.github.io/
Re: Ways of making new style design
« Reply #21 on: April 20, 2015, 08:55:27 pm »
I don't know, just installed lazarus and get impressed with the ddoouubbllee input bug!! :) under lubuntu, so I left it for now.
But I thing it will run fast now...
Something weird about slowness was this, (is other case):
I was using a listbox with ownerdraw that draw some bgrabitmap icons stored in memory in the list. (Each item in the list has their own icon) so it takes time.
I have a combobox with acts as a filter of the listbox, depending the item you choose the list is updated. And the weird is this:
Using default drawing it works fine. Using owner draw the things are messed, the combobox show, for example 'Animals' and I see 'Colors' in the listbox! Because the time of drawing each icon in the list. Is not as faster as the speed I change the combobox items (for example scrolling the items with the mouse..).
Yes, is not so simple to see without the program. Well the application crashes because the icons are referenced to each item in the list:
Add('Animal text', object);
object.Bitmap >> this is the bitmap
This is very powerfull because I can get exactly the correct bitmap for exactly the item index.
But, if the listbox is updated faster than the drawing, when the drawing is coming the indexes are messed (the list that is being drawed is not the same as the current list that is in memory..) so It can't access the correct bitmap and when the ammount of bitmaps and items is different of course it crashes. Imagine intent to acces index 4 when there are only 2 items in the list.
So nice. I don't know if processmessages has something to do or is another unrelated thing.

circular

  • Hero Member
  • *****
  • Posts: 4196
    • Personal webpage
Re: Ways of making new style design
« Reply #22 on: April 21, 2015, 01:36:02 pm »
Hmm I don't know if I understand.

What you can do to avoid pointer references is to store indices to the list, not pointers, to the images. Of course, you need to provider a pointer type.

So for example, you can do ListBox1.AddItem('Animal text', Pointer(animalIndex))
where animalIndex is of type PtrUInt, an integer type compatible with pointers

And then, you retrieve the index with PtrUInt(ListBox1.Items.Objects[currentIndex])
if the index is out of bounds, don't draw anything

Would that solve the problem?
Conscience is the debugger of the mind

lainz

  • Hero Member
  • *****
  • Posts: 4460
    • https://lainz.github.io/
Re: Ways of making new style design
« Reply #23 on: April 21, 2015, 03:29:49 pm »
Yes thankyou.

Just checking if the list is out of bounds, then correcting some other small things it's solved. Thanks.

I've tested lazpaint under lubuntu and works fine except the text tool and inputs in general, but is not a problem of your coding, is just lazarus and a problem with the input method that comes with defaul with the system.

zeljko

  • Hero Member
  • *****
  • Posts: 1594
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Ways of making new style design
« Reply #24 on: April 21, 2015, 04:26:40 pm »
Yes thankyou.

Just checking if the list is out of bounds, then correcting some other small things it's solved. Thanks.

I've tested lazpaint under lubuntu and works fine except the text tool and inputs in general, but is not a problem of your coding, is just lazarus and a problem with the input method that comes with defaul with the system.

For inputs: it's known problem. Try to disable IBUS or similar u have enabled by default and double input will go away.

lainz

  • Hero Member
  • *****
  • Posts: 4460
    • https://lainz.github.io/
Re: Ways of making new style design
« Reply #25 on: April 26, 2015, 04:11:48 am »
For inputs: it's known problem. Try to disable IBUS or similar u have enabled by default and double input will go away.

I know. But I also need to warn the end user and forcing change the configuration of your system

circular

  • Hero Member
  • *****
  • Posts: 4196
    • Personal webpage
Re: Ways of making new style design
« Reply #26 on: April 26, 2015, 01:49:38 pm »
Is that an LCL issue?
Conscience is the debugger of the mind

lainz

  • Hero Member
  • *****
  • Posts: 4460
    • https://lainz.github.io/
Re: Ways of making new style design
« Reply #27 on: April 27, 2015, 07:09:19 pm »
I've readed that is a problem of the interface, so using Qt it will work, but I have no idea.

circular

  • Hero Member
  • *****
  • Posts: 4196
    • Personal webpage
Re: Ways of making new style design
« Reply #28 on: April 28, 2015, 07:18:42 am »
Maybe that will be fixed in future release of Lazarus?
Conscience is the debugger of the mind

lainz

  • Hero Member
  • *****
  • Posts: 4460
    • https://lainz.github.io/
Re: Ways of making new style design
« Reply #29 on: April 28, 2015, 08:31:49 am »
I don't know.. Don't worry about that.

BTW getting back the main discussion back, this is the way of making new style design now:
http://forum.lazarus.freepascal.org/index.php/topic,24239.msg175885.html#msg175885

 

TinyPortal © 2005-2018