Нет, не пробовал.AHAPXICT:сразу за один присест увеличить шрифт от 16 до 96
Если имеется в виду скорость изменения размера, то может мешает моя задержка (delay), которая не позволяет обрабатывать каждый щелчок колеса при быстрой прокрутке колеса. Я это делал намеренно, чтоб не было "перескоков".
В вашем скрипте стр.1013, 1014 и 1015.
- Код: Выделить всё
if (on_text && ShiftDown && !delay){
delay = true;
fdelay();
- Код: Выделить всё
if (on_text && ShiftDown){
//delay = true;
//fdelay();
Я все-таки в какой-то период что-то многое пропустил...,я тогда писал про включение Grab Focus
Добавлено спустя 4 часа 5 минут:
Было такое видео по анимации кнопок.
phpBB [media]
Готовый скрипт.
Папку buttons из архива к паку с Фубаром.
- Код: Выделить всё
// ==PREPROCESSOR==
// @name "control buttons"
// ==/PREPROCESSOR==
function RGB(r,g,b) { return (0xff000000|(r<<16)|(g<<8)|(b)); }
var font = gdi.Font("Arial",12,0);
var ww, wh;
DT_LEFT = 0x00000000;
DT_WORD_ELLIPSIS = 0x00040000;
MF_ENABLED = 0x00000000;
MF_GRAYED = 0x00000001;
MF_SEPARATOR = 0x00000800;
var img_path = fb.ProfilePath + "\\buttons\\";
var b = 5;
var b_x = [];
var b_y = 10;
var b_w = 26; // png 26 x 26
var b_this, b_this_old;
var b_hover_state = [];
var b_hover_alpha = [];
var b_down_state = [];
var b_down_alpha = [];
for (var i = 0; i < b; i++) {
if (!b_hover_state[i]) b_hover_state[i] = 0;
}
var b_mouse_leave = false;
var b_timer_started = false;
var playback_state = 0;
playback_state_is();
var btn = [
gdi.Image(img_path + "stop.png"),
gdi.Image(img_path + "pause.png"),
gdi.Image(img_path + "previous.png"),
gdi.Image(img_path + "play.png"),
gdi.Image(img_path + "next.png")
];
var btn_on = [
gdi.Image(img_path + "stop_on.png"),
gdi.Image(img_path + "pause_on.png"),
gdi.Image(img_path + "previous_on.png"),
gdi.Image(img_path + "play_on.png"),
gdi.Image(img_path + "next_on.png")
];
var btn_is = [
gdi.Image(img_path + "stop_is.png"),
gdi.Image(img_path + "pause_is.png"),
gdi.Image(img_path + "previous_is.png"),
gdi.Image(img_path + "play_is.png"),
gdi.Image(img_path + "next_is.png")
];
function on_paint(gr) {
gr.FillSolidRect(0, 0, ww, wh, RGB(55,70,83));
for (var i = 0; i < b; i++) {
img = btn[i];
gr.DrawImage( img, b_x[i], b_y, b_w, b_w, 0, 0, b_w, b_w, 0, 255);
img = btn_on[i];
b_hover_alpha[i] && gr.DrawImage( img, b_x[i], b_y, b_w, b_w, 0, 0, b_w, b_w, 0, b_hover_alpha[i]);
img = btn_is[i];
b_down_alpha[i] && gr.DrawImage( img, b_x[i], b_y, b_w, b_w, 0, 0, b_w, b_w, 0, b_down_alpha[i]);
}
}
function on_mouse_lbtn_up(x, y) {
button_up_change_state();
if (mouse_on_b(x, y) == 0) {fb.Stop()};
if (mouse_on_b(x, y) == 1) {fb.Pause()};
if (mouse_on_b(x, y) == 2) {fb.Prev()};
if (mouse_on_b(x, y) == 3) {fb.Play()};
if (mouse_on_b(x, y) == 4) {fb.Next()};
playback_state_is();
//window.Repaint();
}
function on_mouse_lbtn_down(x, y) {
button_down_change_state(x, y);
//window.Repaint();
}
function on_mouse_move(x, y) {
button_change_state(x, y);
window.SetCursor(32649);
//window.Repaint();
}
function on_mouse_leave() {
button_leave_change_state();
window.SetCursor(32512);
//window.Repaint();
}
function on_size(){
ww = window.Width;
wh = window.Height;
button_dim();
}
function on_mouse_rbtn_up (x, y){
var _menu = window.CreatePopupMenu();
_menu.AppendMenuItem(MF_ENABLED, 20, "Properties");
_menu.AppendMenuItem(MF_ENABLED, 30, "Configure ...");
ret = _menu.TrackPopupMenu(x, y);
if (ret == 0) return;
switch (ret) {
case 20:
window.ShowProperties();
break;
case 30:
window.ShowConfigure();
break;
}
_menu.Dispose();
return true;
}
// ************* buttons state
function playback_state_is() {
playback_state = fb.IsPaused ? 1 : fb.IsPlaying ? 3 : 0;
b_down_state[playback_state] = 1;
for (var i in b_hover_state) {
if (b_down_state[i] != 0 && i != playback_state) {
b_down_state[i] = 0;
button_change_state();
}
}
}
function on_playback_starting(){
playback_state_is();
}
function on_playback_pause(state) {
playback_state_is();
}
function on_playback_stop() {
playback_state_is();
}
// ************* anim buttons
function button_down_change_state(x, y) {
b_this = mouse_on_b(x, y)
b_down_state[b_this] = 1;
}
function button_up_change_state() {
for (var i in b_down_state) {
b_down_state[i] = 0;
}
}
function button_change_state(x, y) {
if (!b_timer_started) button_alpha_timer();
for (var i in b_x) {
b_this = mouse_on_b(x, y);
}
if (b_this) {
b_hover_state[b_this] = 1;
}
if (!b_this) {
b_hover_state[b_this_old] = 0;
}
b_this_old = b_this;
}
function button_leave_change_state() {
for (var i in b_hover_state) {
if (b_hover_state[i] != 0) {
b_hover_state[i] = 0;
}
}
b_mouse_leave = true;
}
function button_alpha_timer() {
b_timer_started = true;
on_step = 64;
off_step = 10;
b_timer = window.SetInterval(function() {
for (var i in b_hover_state) {
if (!b_hover_alpha[i]) b_hover_alpha[i] = 0;
switch (b_hover_state[i]) {
case 0:
b_hover_alpha[i] = Math.max(0, b_hover_alpha[i] -= off_step);
break;
case 1:
b_hover_alpha[i]= Math.min(255, b_hover_alpha[i] += on_step);
break;
}
window.Repaint();
}
for (var i in b_down_state) {
if (!b_down_alpha[i]) b_down_alpha[i] = 0;
switch (b_down_state[i]) {
case 0:
b_down_alpha[i] = Math.max(0, b_down_alpha[i] -= off_step);
break;
case 1:
b_down_alpha[i]= Math.min(255, b_down_alpha[i] += on_step);
break;
}
window.Repaint();
}
if (b_mouse_leave && Math.max.apply(null, b_hover_alpha) <= 0){
b_timer_started = false;
b_mouse_leave = false;
window.ClearInterval(b_timer);
}
}, 30);
}
function button_dim() {
b_x = [];
bw = ww / (b + 1);
for (var i = 1; i <= b; i++) {
b_x.push(Math.round( bw * i - b_w / 2 ));
}
}
function mouse_on_b(x, y){
for (var i in b_x) {
if (x >= b_x[i] && x <= b_x[i] + b_w && y >= b_y && y <= b_y + b_w) return i;
}
}