swftools-common
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Swftools-common] rfxview change page number


From: Johannes Wilm
Subject: [Swftools-common] rfxview change page number
Date: Wed, 10 Dec 2008 00:35:58 -0600

Hey,
with the attached patch one can manually change the page number and the viewer automatically "jumps" to the correct page number. It only works with docs of up to 999 pages.

If anyone out there is hacking on rfxview as well, I'd like to hear from you. I saw the priority list which included searching for and printing and I'd really like to know if anyone is working on that right now.

Thanks in advance!

-- -- -- --

--- rfxview.sc.original    2008-12-06 14:37:24.000000000 -0600
+++ rfxview.sc    2008-12-09 22:06:32.000000000 -0600
@@ -298,18 +298,25 @@
 .put hscrollbar y=height-22 x=10
 .put vscrollbar x=width-22 y=40
 
-.edittext et width=110 height=20 font=arial size=18pt color=black noselect align=center
+.edittext et width=50 height=20 font=arial size=18pt color=black variable=current_pagenumber maxlength=3 text="1" align=left
+.edittext etmiddle text="/" width=10 height=25 font=arial color=black noselect size=18pt align=center
+.edittext et_total_pages width=50 height=25 font=arial color=black noselect size=18pt align=right
 
-.font dbgarial filename="../wx/Courier.ttf"
+
+.font dbgarial filename="/usr/share/fonts/truetype/msttcorefonts/Arial_Bold.ttf"
 #.edittext debugtxt width=width height=20 font=dbgarial size=18pt color=#004000 noselect
 #.put debugtxt y=20
 
-.put et x=width/2-30 y=8
+.put et x=width/2-55 y=8
+.put etmiddle x=width/2-5 y=8
+.put et_total_pages x=width/2+5 y=8
 
 #.swf viewport filename=paper5.swf
 .sprite viewport
 .end
 
+
+
 .box f width=100 height=100 line=0 fill=black
 
 .button areabutton
@@ -331,8 +338,9 @@
 .put cliparea=cf x=10 y=40
 .put viewport x=10 y=40
 
-.action:
 
+.action:
+    et_total_pages.text=viewport._totalframes;
     swfwidth = viewport._width;
     swfheight = viewport._height;
 
@@ -358,7 +366,9 @@
     l1._x = fullwidth/2-100 - l1._width/2;
     r1._x = fullwidth/2+100 - r1._width/2;
 
-    et._x = fullwidth/2 - et._width/2;
+    et._x = fullwidth/2 - (et._width+etmiddle._width+et_total_pages._width)/2;
+    etmiddle._x = fullwidth/2 - (et._width+etmiddle._width+et_total_pages._width)/2 + et._width;
+    et_total_pages._x = fullwidth/2 - (et._width+etmiddle._width+et_total_pages._width)/2 + et._width+etmiddle._width;
 
     //.box f width=width-40 height=height-40-30 line=0 fill=black
     //.box vscroll1 width=10 height=height-40-30 line=1 color=#00000060 fill=grad7
@@ -404,8 +414,9 @@
     
     //debugtxt.text = Stage.width+ " x " + Stage.height;
 
+   
     setPageNr = function() {
-    et.text = "  "+pagenr+" / "+viewport._totalframes;
+    current_pagenumber = pagenr;
     viewport.gotoAndStop(pagenr);
     };
   
@@ -529,6 +540,14 @@
         setPageNr();
     }
     };
+    et.
+    if(current_pagenumber <= viewport._totalframes) {
+            if (current_pagenumber > 0) {
+          pagenr = int(current_pagenumber);
+          setPageNr();
+        }
+    }
+    };
     r1.
     if(pagenr < viewport._totalframes) {
         pagenr = pagenr + 1;


--
Johannes Wilm
http://www.johanneswilm.org
tel: +5059173717


reply via email to

[Prev in Thread] Current Thread [Next in Thread]