Advertisement
Guest User

Untitled

a guest
Feb 24th, 2018
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (
  2. var updateFont,size = 100;
  3. w = Window("Mapa de caracteres", Rect(20, Window.screenBounds.height - 500, 600, 400),scroll:true).front;
  4. w.view.decorator = FlowLayout(w.view.bounds);
  5. StaticText.new(w, Rect(5, 0, 30, 20)).string_("Font").align_(\right);
  6. m = PopUpMenu(w, Rect(40, 0, 250, 20));
  7. m.items = Font.availableFonts;
  8.  
  9. StaticText.new(w, Rect(290, 0, 28, 20)).string_("Size").align_(\right);
  10. y = PopUpMenu(w, Rect(322, 0, 50, 20));
  11. y.items = Array.series(100,20,10);
  12.  
  13. w.view.decorator = FlowLayout( w.view.bounds, 0@40, size@size );
  14.  
  15. //Iteraciones para el mapa de caracteres
  16. t=255.do{ |i|
  17.     var t,font="Arial";
  18.     t=[i, (i.asAscii).asCompileString];
  19.     StaticText( w.view,(size*3)@(size*2) ).string_(if (t.asString.contains(".asAscii")==true,{t[0]},{(t.asString).replace("$","").replace("[","").replace("]","").replace("\,","").replace("\\","")})).font_(Font(font,size)) };
  20.  
  21. //Si le cambio al tipo de letra
  22. y.action = {
  23.     var font;
  24.     font = Font(m.items[m.value],y.items[y.value].asInteger);
  25.     t=255.do{ |i|
  26.     var t;
  27.     t=[i, (i.asAscii).asCompileString];
  28.     StaticText( w.view,(size*3)@(size*2) ).string_(if (t.asString.contains(".asAscii")==true,{t[0]},{(t.asString).replace("$","").replace("[","").replace("]","").replace("\,","").replace("\\","")})).font_(font) };
  29. };
  30.  
  31. //Si le cambio el tamaño
  32. m.action = y.action;
  33. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement