From c5716ff2e16dbc101087a273e0d622736f5bdf53 Mon Sep 17 00:00:00 2001 From: slava Date: Sun, 9 Jul 2006 19:57:34 +0000 Subject: [PATCH] Fix problem where help window shows wrong page initially --- README.txt | 12 ++++++++++++ TODO.FACTOR.txt | 4 +++- doc/handbook/handbook.facts | 4 ++-- library/kernel.facts | 4 ++-- library/ui/gadgets/incremental.factor | 3 ++- library/ui/hierarchy.factor | 13 +++---------- library/ui/tools/help.factor | 3 +++ library/ui/ui.factor | 2 +- 8 files changed, 28 insertions(+), 17 deletions(-) diff --git a/README.txt b/README.txt index a0eeda21c4..3d7042bcac 100644 --- a/README.txt +++ b/README.txt @@ -11,6 +11,7 @@ implementation. It is not an introduction to the language itself. - Building Factor - Running Factor on Unix with X11 - Running Factor on Mac OS X +- Running Factor on Windows - Source organization - Community - Credits @@ -23,6 +24,7 @@ Factor is fully supported on the following platforms: Linux/AMD64 Mac OS X/x86 Mac OS X/PowerPC + MS Windows XP The following platforms should work, but are not tested on a regular basis: @@ -137,6 +139,16 @@ this point), and the library source into a self-contained Factor.app. Factor.app runs the UI when double-clicked and can be transported between PowerPC Macs. +* Running Factor on Windows + +If you did not download the binary package, you can bootstrap Factor in +the command prompt: + + f.exe boot.image.pentium4 (or boot.image.x86) + +Once bootstrapped, double-clicking f.exe starts the Factor UI. There is +no option to run the listener in the command prompt on Windows. + * Source organization doc/ - the developer's handbook, and various other bits and pieces diff --git a/TODO.FACTOR.txt b/TODO.FACTOR.txt index 3f7f96057f..92315e961a 100644 --- a/TODO.FACTOR.txt +++ b/TODO.FACTOR.txt @@ -1,6 +1,5 @@ + tomorrow: -- help gadget: opens 'f' initially - amd64 crash + day after: @@ -21,6 +20,9 @@ + ui: +- markup: goofy if a block is the first thing in a table cell +- ui uses too much cpu time idling +- table borders rendered badly - why is the thumb skewed? - add some handy services: - base conversion diff --git a/doc/handbook/handbook.facts b/doc/handbook/handbook.facts index 5d379be9aa..3ff7031762 100644 --- a/doc/handbook/handbook.facts +++ b/doc/handbook/handbook.facts @@ -7,8 +7,8 @@ ARTICLE: "handbook" "Factor documentation" { $list { "Load source files using " { $link run-file } ":" { $code "\"examples/lcd.factor\" run-file" } } - { "Load modules from " { $snippet "contrib/" } " using " { $link require } ":" } - { $code "\"httpd\" require" } + { { "Load modules from " { $snippet "contrib/" } " using " { $link require } ":" } + { $code "\"httpd\" require" } } { { $link .s } " prints the contents of the stack." } { { $link . } " prints the object at the top of the stack." } } diff --git a/library/kernel.facts b/library/kernel.facts index 4f4e78150d..746300bc5a 100644 --- a/library/kernel.facts +++ b/library/kernel.facts @@ -240,11 +240,11 @@ $terpri { $code "X [ Y ] unless*" "X dup [ ] [ drop Y ] if" } } ; HELP: ?if "( default cond true false -- )" -{ $values { "cond" "a generalized boolean" } { "true" "a quotation with stack effect " { $snippet "( cond -- )" } } { "false" "a quotation with stack effect " { $snippet "( default -- )" } } } +{ $values { "default" "an object" } { "cond" "a generalized boolean" } { "true" "a quotation with stack effect " { $snippet "( cond -- )" } } { "false" "a quotation with stack effect " { $snippet "( default -- )" } } } { $description "If the condition is " { $link f } ", the " { $snippet "false" } " quotation is called with the " { $snippet "default" } " value on the stack. Otherwise, the " { $snippet "true" } " quotation is called with the condition on the stack." $terpri "The following two lines are equivalent:" -{ $code "X [ Y ] [ Z ] ?if" "X dup [ nip Y ] [ drop Z ] if" } } ; +{ $code "[ X ] [ Y ] ?if" "dup [ nip X ] [ drop Y ] if" } } ; HELP: keep-datastack "( quot -- )" { $values { "quot" "a quotation" } } diff --git a/library/ui/gadgets/incremental.factor b/library/ui/gadgets/incremental.factor index 4626bf7c73..f88cb89e99 100644 --- a/library/ui/gadgets/incremental.factor +++ b/library/ui/gadgets/incremental.factor @@ -45,7 +45,8 @@ M: incremental pref-dim* ( incremental -- dim ) over prefer-incremental 2dup incremental-loc tuck update-cursor - prefer-incremental ; + dup prefer-incremental + gadget-parent [ invalidate* ] when* ; : clear-incremental ( incremental -- ) dup (clear-gadget) dup forget-pref-dim diff --git a/library/ui/hierarchy.factor b/library/ui/hierarchy.factor index c56d4cbb11..aa03629a9f 100644 --- a/library/ui/hierarchy.factor +++ b/library/ui/hierarchy.factor @@ -71,14 +71,13 @@ M: gadget ungraft* drop ; % ] [ ] make call ; -: (parents) ( gadget vector -- ) - over - [ 2dup push >r gadget-parent r> (parents) ] [ 2drop ] if ; +: (parents) ( gadget -- ) + [ dup , gadget-parent (parents) ] when* ; : parents ( gadget -- vector ) #! A list of all parents of the gadget, the first element #! is the gadget itself. - V{ } clone [ (parents) ] keep ; + [ (parents) ] { } make ; : each-parent ( gadget quot -- ? ) >r parents r> all? ; inline @@ -90,12 +89,6 @@ M: gadget ungraft* drop ; #! The position of the gadget on the screen. parents { 0 0 } [ rect-loc v+ ] reduce ; -: gadget-point ( gadget vector -- point ) - #! { 0 0 } - top left corner - #! { 1/2 1/2 } - middle - #! { 1 1 } - bottom right corner - >r dup screen-loc swap rect-dim r> v* v+ ; - : relative-loc ( g1 point -- point-g1 ) swap screen-loc v- ; : child? ( parent child -- ? ) parents memq? ; diff --git a/library/ui/tools/help.factor b/library/ui/tools/help.factor index a0aa910240..d1acc57dc3 100644 --- a/library/ui/tools/help.factor +++ b/library/ui/tools/help.factor @@ -39,6 +39,9 @@ M: help-gadget gadget-title help-gadget-history [ "Help - " swap article-title append ] ; +M: help-gadget pref-dim* + drop { 500 600 } ; + : help-tool [ help-gadget? ] [ ] diff --git a/library/ui/ui.factor b/library/ui/ui.factor index 3c0e1554b9..efb5fa2bd8 100644 --- a/library/ui/ui.factor +++ b/library/ui/ui.factor @@ -83,7 +83,7 @@ C: titled-gadget ( gadget title -- ) [ world-gadget swap call ] find-last-with nip ; inline : open-tool ( arg cons setter -- ) - >r call tuck r> call open-window ; inline + >r call dup open-window r> call ; inline : call-tool ( arg pred cons setter -- ) rot find-window [