Server IP : 103.119.228.120 / Your IP : 3.142.131.51 Web Server : Apache System : Linux v8.techscape8.com 3.10.0-1160.119.1.el7.tuxcare.els2.x86_64 #1 SMP Mon Jul 15 12:09:18 UTC 2024 x86_64 User : nobody ( 99) PHP Version : 5.6.40 Disable Function : shell_exec,symlink,system,exec,proc_get_status,proc_nice,proc_terminate,define_syslog_variables,syslog,openlog,closelog,escapeshellcmd,passthru,ocinum cols,ini_alter,leak,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dl,dll,myshellexec,proc_open,socket_bind,proc_close,escapeshellarg,parse_ini_filepopen,fpassthru,exec,passthru,escapeshellarg,escapeshellcmd,proc_close,proc_open,ini_alter,popen,show_source,proc_nice,proc_terminate,proc_get_status,proc_close,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,dl,symlink,shell_exec,system,dl,passthru,escapeshellarg,escapeshellcmd,myshellexec,c99_buff_prepare,c99_sess_put,fpassthru,getdisfunc,fx29exec,fx29exec2,is_windows,disp_freespace,fx29sh_getupdate,fx29_buff_prepare,fx29_sess_put,fx29shexit,fx29fsearch,fx29ftpbrutecheck,fx29sh_tools,fx29sh_about,milw0rm,imagez,sh_name,myshellexec,checkproxyhost,dosyayicek,c99_buff_prepare,c99_sess_put,c99getsource,c99sh_getupdate,c99fsearch,c99shexit,view_perms,posix_getpwuid,posix_getgrgid,posix_kill,parse_perms,parsesort,view_perms_color,set_encoder_input,ls_setcheckboxall,ls_reverse_all,rsg_read,rsg_glob,selfURL,dispsecinfo,unix2DosTime,addFile,system,get_users,view_size,DirFiles,DirFilesWide,DirPrintHTMLHeaders,GetFilesTotal,GetTitles,GetTimeTotal,GetMatchesCount,GetFileMatchesCount,GetResultFiles,fs_copy_dir,fs_copy_obj,fs_move_dir,fs_move_obj,fs_rmdir,SearchText,getmicrotime MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/local/ssl/local/ssl/local/ssl/local/ssl/local/ssl/local/ssl/share/tk8.5/ttk/ |
Upload File : |
# # ttk::spinbox bindings # namespace eval ttk::spinbox { } ### Spinbox bindings. # # Duplicate the Entry bindings, override if needed: # ttk::copyBindings TEntry TSpinbox bind TSpinbox <Motion> { ttk::spinbox::Motion %W %x %y } bind TSpinbox <ButtonPress-1> { ttk::spinbox::Press %W %x %y } bind TSpinbox <ButtonRelease-1> { ttk::spinbox::Release %W } bind TSpinbox <Double-Button-1> { ttk::spinbox::DoubleClick %W %x %y } bind TSpinbox <Triple-Button-1> {} ;# disable TEntry triple-click bind TSpinbox <KeyPress-Up> { event generate %W <<Increment>> } bind TSpinbox <KeyPress-Down> { event generate %W <<Decrement>> } bind TSpinbox <<Increment>> { ttk::spinbox::Spin %W +1 } bind TSpinbox <<Decrement>> { ttk::spinbox::Spin %W -1 } ttk::bindMouseWheel TSpinbox [list ttk::spinbox::MouseWheel %W] ## Motion -- # Sets cursor. # proc ttk::spinbox::Motion {w x y} { if { [$w identify $x $y] eq "textarea" && [$w instate {!readonly !disabled}] } { ttk::setCursor $w text } else { ttk::setCursor $w "" } } ## Press -- # proc ttk::spinbox::Press {w x y} { if {[$w instate disabled]} { return } focus $w switch -glob -- [$w identify $x $y] { *textarea { ttk::entry::Press $w $x } *rightarrow - *uparrow { ttk::Repeatedly event generate $w <<Increment>> } *leftarrow - *downarrow { ttk::Repeatedly event generate $w <<Decrement>> } *spinbutton { if {$y * 2 >= [winfo height $w]} { set event <<Decrement>> } else { set event <<Increment>> } ttk::Repeatedly event generate $w $event } } } ## DoubleClick -- # Select all if over the text area; otherwise same as Press. # proc ttk::spinbox::DoubleClick {w x y} { if {[$w instate disabled]} { return } switch -glob -- [$w identify $x $y] { *textarea { SelectAll $w } * { Press $w $x $y } } } proc ttk::spinbox::Release {w} { ttk::CancelRepeat } ## MouseWheel -- # Mousewheel callback. Turn these into <<Increment>> (-1, up) # or <<Decrement> (+1, down) events. # proc ttk::spinbox::MouseWheel {w dir} { if {$dir < 0} { event generate $w <<Increment>> } else { event generate $w <<Decrement>> } } ## SelectAll -- # Select widget contents. # proc ttk::spinbox::SelectAll {w} { $w selection range 0 end $w icursor end } ## Limit -- # Limit $v to lie between $min and $max # proc ttk::spinbox::Limit {v min max} { if {$v < $min} { return $min } if {$v > $max} { return $max } return $v } ## Wrap -- # Adjust $v to lie between $min and $max, wrapping if out of bounds. # proc ttk::spinbox::Wrap {v min max} { if {$v < $min} { return $max } if {$v > $max} { return $min } return $v } ## Adjust -- # Limit or wrap spinbox value depending on -wrap. # proc ttk::spinbox::Adjust {w v min max} { if {[$w cget -wrap]} { return [Wrap $v $min $max] } else { return [Limit $v $min $max] } } ## Spin -- # Handle <<Increment>> and <<Decrement>> events. # If -values is specified, cycle through the list. # Otherwise cycle through numeric range based on # -from, -to, and -increment. # proc ttk::spinbox::Spin {w dir} { set nvalues [llength [set values [$w cget -values]]] set value [$w get] if {$nvalues} { set current [lsearch -exact $values $value] set index [Adjust $w [expr {$current + $dir}] 0 [expr {$nvalues - 1}]] $w set [lindex $values $index] } else { if {[catch { set v [expr {[scan [$w get] %f] + $dir * [$w cget -increment]}] }]} { set v [$w cget -from] } $w set [FormatValue $w [Adjust $w $v [$w cget -from] [$w cget -to]]] } SelectAll $w uplevel #0 [$w cget -command] } ## FormatValue -- # Reformat numeric value based on -format. # proc ttk::spinbox::FormatValue {w val} { set fmt [$w cget -format] if {$fmt eq ""} { # Try to guess a suitable -format based on -increment. set delta [expr {abs([$w cget -increment])}] if {0 < $delta && $delta < 1} { # NB: This guesses wrong if -increment has more than 1 # significant digit itself, e.g., -increment 0.25 set nsd [expr {int(ceil(-log10($delta)))}] set fmt "%.${nsd}f" } else { set fmt "%.0f" } } return [format $fmt $val] } #*EOF*