Home » Developing U++ » U++ Developers corner » styling of widgets ( animation / look and feel)
Re: styling of widgets ( animation / look and feel) [message #59811 is a reply to message #59810] |
Thu, 20 April 2023 22:36   |
dodobar
Messages: 22 Registered: April 2023 Location: Germany
|
Promising Member |
|
|
agreed this was to get the ball rolling:
perhaps:
struct Style : ChStyle<Style> {
Value look[4];
Color monocolor[4], textcolor[4];
Point pressoffset;
int focusmargin;
int overpaint;
Font font;
Image ok, cancel, exit;
bool transparent;
bool focus_use_ok;
// Animation properties
enum AnimationFinishBehavior {
GOTO_FIRST, // Go to the first frame when the animation is interrupted
GOTO_LAST, // Go to the last frame when the animation is interrupted
COMPLETE, // Complete the animation normally when interrupted
COMPLETE_FAST, // Complete the animation quickly when interrupted
HOLD, // Hold the current frame when the animation is interrupted
REVERSE // Reverse the animation when interrupted
};
AnimationFinishBehavior animationFinishBehavior;
double animation_duration; // Duration of the animation in seconds
double (*animation_easing_function)(double); // Easing function for the animation
};
and ChStyle perhaps:
template <class T>
struct ChStyle {
// ...
std::vector<T> animationStates;
double animationDuration;
EasingFunction easingFunction;
// ...
};
obviously the drawing functions like ChPaint, ChPaintEdge, and ChPaintBody would need to incorporate the animation properties.
The BaseAnimation class could still handle animation logic and calculate the intermediate values
certainly the case of handling Mouse event (e.g., OnMouseEnter, OnMouseLeave)
would need to have some form of update to the animation system
void Button::OnMouseEnter() {
// notify Update the animation state
// ...
// notify Start the animation
// ...
}
void Button::OnMouseLeave() {
// notify Update the animation state
// ...
// notify Start the animation
// ...
}
[Updated on: Thu, 20 April 2023 22:45] Report message to a moderator
|
|
|
 |
|
styling of widgets ( animation / look and feel)
By: dodobar on Sun, 16 April 2023 20:54
|
 |
|
Re: styling of widgets ( animation / look and feel)
By: Novo on Mon, 17 April 2023 15:53
|
 |
|
Re: styling of widgets ( animation / look and feel)
By: mirek on Tue, 18 April 2023 09:17
|
 |
|
Re: styling of widgets ( animation / look and feel)
By: dodobar on Thu, 20 April 2023 00:37
|
 |
|
Re: styling of widgets ( animation / look and feel)
By: mirek on Thu, 20 April 2023 08:58
|
 |
|
Re: styling of widgets ( animation / look and feel)
By: dodobar on Thu, 20 April 2023 13:00
|
 |
|
Re: styling of widgets ( animation / look and feel)
By: dodobar on Thu, 20 April 2023 13:06
|
 |
|
Re: styling of widgets ( animation / look and feel)
By: mirek on Thu, 20 April 2023 14:22
|
 |
|
Re: styling of widgets ( animation / look and feel)
By: dodobar on Thu, 20 April 2023 19:17
|
 |
|
Re: styling of widgets ( animation / look and feel)
By: mirek on Thu, 20 April 2023 21:51
|
 |
|
Re: styling of widgets ( animation / look and feel)
By: dodobar on Thu, 20 April 2023 22:36
|
 |
|
Re: styling of widgets ( animation / look and feel)
By: dodobar on Thu, 20 April 2023 23:55
|
 |
|
Re: styling of widgets ( animation / look and feel)
By: mirek on Fri, 21 April 2023 07:56
|
 |
|
Re: styling of widgets ( animation / look and feel)
By: dodobar on Fri, 21 April 2023 11:40
|
 |
|
Re: styling of widgets ( animation / look and feel)
By: mirek on Sat, 22 April 2023 14:44
|
 |
|
Re: styling of widgets ( animation / look and feel)
By: dodobar on Sun, 23 April 2023 16:27
|
 |
|
Re: styling of widgets ( animation / look and feel)
By: mirek on Mon, 24 April 2023 09:23
|
 |
|
Re: styling of widgets ( animation / look and feel)
By: dodobar on Mon, 09 September 2024 09:10
|
 |
|
Re: styling of widgets ( animation / look and feel)
By: mirek on Mon, 09 September 2024 10:03
|
 |
|
Re: styling of widgets ( animation / look and feel)
By: dodobar on Sun, 22 September 2024 09:28
|
 |
|
Re: styling of widgets ( animation / look and feel)
By: mirek on Sun, 22 September 2024 09:38
|
Goto Forum:
Current Time: Sat Jul 12 09:15:40 CEST 2025
Total time taken to generate the page: 0.06498 seconds
|