
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
For me, it's easier to create a product development team, whose members, to an agreed degree, will receive a profit from the product sales (maybe someone is the project ideologist, someone finances for a share, someone is the programmer).
And since everyone is financially motivated, to implement the necessary libraries for the interface as part of the project as well.
For me, it's easier to create a product development team, whose members, to an agreed extent, will receive a profit from the product sales (maybe someone is the project ideologist, someone finances for a share, someone is the programmer).
And since all are financially motivated - to implement within the project and the necessary libraries for the interface.
I've read the thread and still don't understand why it's necessary to draw a button on Canvas from scratch. Can you explain without emotions?
because MT developers are not omnipotent and it is time consuming to bother them with petty requests
Why it might come in handy:
1. the interface on the bitmap is fast. So fast that it is almost indistinguishable from the system one. For example, I've implemented semi-transparent elements with gradients andeven when they move they are smoothly rendered without visible delay, taking into account the colour mixing and alpha channel calculation on other objects with semi-transparent gradients.
2. the interface is scalable. You can make the application more complex and it won't slow down due to deletion and creation of a large number of graph objects. Redrawing costs are minimal, it is only a replacement of a picture in a thousandth of a second.
3. ready-made controls can be created and new ones can be created as you can provide your own event pool, for example:
OnMouseDown - pressed the LKM
OnMouseUp - pressed the LKM
OnMouseHoverOn - hover the mouse cursor over an object
OnMouseHoverOut - move mouse cursor away from object
OnMouseClick - press and click within the object boundaries
OnMouseDblClick - double mouse click within the bounds of the object
OnDragStart - event that occurs once at the beginning of movement with pressed left mouse button
OnDragMove - event generated during movement with the left mouse button
OnDragEnd - event generated after moving with LKM
OnPut - object is cast to another object
OnGet - object is dumped to another object
OnFocus - object got focus
OnBlur - object loses focus
OnResize - object has changed size
OnParentResize - the parent object has changed size
OnKeyPress - a key pressed
OnChange - value of a field changed
etc.
Why it might come in handy:
1. the interface on the bitmap is fast. So fast that it is virtually indistinguishable from the system interface. For example, I've implemented semi-transparent elements with gradients andeven when they move, they are smoothly rendered without any visible delay, taking into account the colour mixing and alpha channel calculation on other objects with semi-transparent gradients.
2. the interface is scalable. You can make the application more complex and it won't slow down due to deletion and creation of a large number of graph objects. Redrawing costs are minimal, it is only a replacement of a picture in a thousandth of a second.
3. ready-made controls can be created and new ones can be created as you can provide your own event pool, for example:
OnMouseDown - pressed the LKM
OnMouseUp - pressed the LKM
OnMouseHoverOn - hover the mouse cursor over an object
OnMouseHoverOut - move mouse cursor away from object
OnMouseClick - press and click within the object boundaries
OnMouseDblClick - double mouse click within the bounds of the object
OnDragStart - event that occurs once at the beginning of movement with pressed left mouse button
OnDragMove - event generated during movement with the left mouse button
OnDragEnd - event generated after moving with LKM
OnPut - object is cast to another object
OnGet - object is dumped to another object
OnFocus - object got focus
OnBlur - object loses focus
OnResize - object has changed size
OnParentResize - the parent object has changed size
OnKeyPress - key pressed
OnChange - value of a field changed
etc.
Exhaustive, thank you!
@Igor Volodin, @Combinator, @Anatoli Kazharski
I'll start with the sore subject.)
The issue that concerns me the most is some kind of universality/abstraction for storing rendering parameters.
----
As we understand all controls use font, background colour and text colour equally, etc.
When all these parameters are the same for all controls, then the interface has a common look with a single concept.
But how to store them? because controls don't always use all the parameters.
+ The system is complicated by the fact that elements have different states that should use font and background colours differently. They are Active, Disable, Over, or Select, etc.
+ there are groups of controllers - relief (like Button) and input fields (like Edit, List), and when is the background to render them
----
In the current working idea I have a minimum attribute element of class GAttribBase, which contains 5 basic parameters (font/size, background/ border colour, border size)
These base elements are used to form an array for the GAttributribut class states (Active/Disabvle/Over/Select, etc.).
And then GAttribut is populated for the different element types - Relief, Editable, etc.
So, we fill in rendering parameters once (we store them in xml), they can be edited in order to create different designs and we use them globally without defining them for every controller.
Of course, if you want to define rendering parameters for some control, just create in the control a GAttributribut object and specify the desired colours.
----
This model works, the unified design is achieved in no time, all the controls take the colours from the common array.
But in my opinion, it's not universal. The user doesn't understand which parameters from the base GAttribBase are used for rendering of this or that control.
For coder to know exactly what colour must be changed, he would have to look into rendering function of the control. Which is really bothersome.
-----
Anyway, any ideas for the coder to be free from colour management (to use predefined colours straight away and not to bother with them in the beginning).
On the other hand, if he wants to re-color some of the controls on the screen, he doesn't have to investigate what GAttribBase is used and in what case.
@Igor Volodin, @Combinator, @Anatoli Kazharski
In general - what ideas do you have for the coder to be free of colour work on the one hand (so that it uses the laid in colours straight away and doesn't bother with them at the beginning)
And on the other hand, if they want to re-color some of the controls on the screen, they can do it without going into the maze of drawing functions and searching for what GAttribBase is used and in what case.
Ok, themes.
For example, the main object of our application, let's call it App, is associated with ConcreteTheme object.
What is a theme object:
colours (background, foreground, disable, active, etc.), base sizes, font sizes for standard cases: titlesize, commonsize, etc. sprites for: panels, buttons, checkboxes, etc.
A new theme is a new class/structure with changed values. But it's better that themes can be inherited by overriding only certain parameters.
The rest - the hierarchy of controls in which each controller uses one of the necessary values of the object-theme by default. If it needs to override this, we call a method to work with that property, specifying the new value.
For example SetBgColor(XRGB(255,0,128));
CView - a basic class providing basic event-based interaction
- CRect - coordinates
- Cpanel has a bgcolor
- CButton has a state object, each state has bg
- CText has a text colour and font properties
- CCircle
And so on.
If you want to use xml to describe the elements,
then for each class control or primitive we need to create a generating class let's call it "build-container" which will map attributes (bgcolor="(255,0,128)") to the corresponding methods ( SetBgColor(attrValue) ) of the class. Such build containers will be parsed by XML parser, the output will be an object initialized with needed values, or with default ones if no values were specified.
Here Theme is the same as mine - a set of GAttributors for different types of controls and their states.
but you already suggest the first step on the way to transparency for coder - add functions to specific control to change its rendering properties (SetBgColor etc.)
Basically I agree, it will be clear what colours it has and what can be changed.
such a question then - does Theme imply redundancy of unused parameters?
Let's say that in my basic GAttribBase for some control (e.g. button) we use only background colour and size, and other parameters - border thickness etc. are not used in this control.
That is - do you have a base element for all controls? where the information is stored "for all cases", or all controls have only their own parameters without the universality overhead?
...
In general - what are some ideas for the coder to be free from handling colours (so that it would use default colours and not bother with them in the beginning)
And on the other hand - so that if he wants to re-color some controller on the screen, he doesn't have to dive into the wilderness of rendering functions and find out what GAttribBase is used and in what case.
Set default values for each item. If user needs to change something, for each item property there should be a method to set new value. This is how I have it done now.
I don't have this yet:
But all this is my reasoning regarding my scheme. I don't rule out that it will still change a lot when I start the transition. So everything I wrote above may no longer be relevant to the topic under discussion here. )