ImageMorph subclass: #CelluleImageMorph instanceVariableNames: 'source lien ' classVariableNames: '' poolDictionaries: '' category: 'nightMareWeaverVersion1'! !CelluleImageMorph commentStamp: '' prior: 0! encapsule une image, en y associant des caractŽristiques spŽcifiques...! !CelluleImageMorph methodsFor: 'dropping/grabbing' stamp: 'vince 7/23/2001 08:34'! acceptDroppingMorph: aMorph event: evt | cel | (evt confirm:'Voulez vous crŽer un Roll-Over?') ifTrue:[ cel_CelluleImageSurvoleeMorph avec: self survolee: aMorph. cel openInWorld. aMorph delete. self owner acceptDroppingMorph: cel event: evt. self delete.] ifFalse:[ aMorph slideBackToFormerSituation: evt.]. ! ! !CelluleImageMorph methodsFor: 'dropping/grabbing' stamp: 'vince 7/23/2001 07:19'! handlesMouseDown: evt ^evt shiftPressed not.! ! !CelluleImageMorph methodsFor: 'dropping/grabbing' stamp: 'vince 7/11/2001 18:11'! mouseDown: evt evt yellowButtonPressed ifTrue: [^ self yellowButtonActivity: evt].! ! !CelluleImageMorph methodsFor: 'dropping/grabbing' stamp: 'vince 7/19/2001 12:35'! wantsDroppedMorph: aMorph event: evt ^(aMorph class=CelluleImageMorph) ! ! !CelluleImageMorph methodsFor: 'initialization' stamp: 'vince 7/12/2001 12:54'! initialize super initialize. self lien:''. ! ! !CelluleImageMorph methodsFor: 'accessing' stamp: 'vince 7/11/2001 15:32'! lien ^lien! ! !CelluleImageMorph methodsFor: 'accessing' stamp: 'vince 7/11/2001 15:34'! lien: unLien lien_unLien! ! !CelluleImageMorph methodsFor: 'accessing' stamp: 'vince 7/11/2001 15:32'! source ^source ! ! !CelluleImageMorph methodsFor: 'accessing' stamp: 'vince 7/11/2001 15:34'! source: uneString source_uneString ! ! !CelluleImageMorph methodsFor: 'menu commands' stamp: 'vince 7/17/2001 10:59'! ajouterLien " mailto:jojo@machin.com ou http://www.truc.com ou music/track1.mp3 par exemple. " | link | link_FillInTheBlank request:'Entrez l''url.' initialAnswer:'http://www.ajt.fr'. self lien: link.! ! !CelluleImageMorph methodsFor: 'menu' stamp: 'vince 7/16/2001 15:52'! leMenu:evt | menu | menu_MenuMorph new. menu add: 'x fermer' target: menu action: #delete. menu addLine. menu add: 'ajouter un lien' target: self action:#ajouterLien. menu addLine. menu add: 'ajouter comme arrire-plan' target: owner selector:#dessineFond: argument:self. menu position: evt cursorPoint. menu openInWorld.! ! !CelluleImageMorph methodsFor: 'menu' stamp: 'vince 7/11/2001 18:12'! yellowButtonActivity: evt self leMenu: evt.! ! !CelluleImageMorph methodsFor: 'printing' stamp: 'vince 7/17/2001 11:00'! ecrireCellule: monHtml "Žcrit le code html relatif ˆ la cellule dans un stream FichierHtml" (self lien ~= '') ifTrue:[monHtml command:'a href=',self lien.]. monHtml command:('IMG src=', self source,' width=',self extent x printString,' height=',self extent y printString,' border=0'). (self lien ~= '') ifTrue:[monHtml command:'/a'.].! ! !CelluleImageMorph methodsFor: 'geometry' stamp: 'vince 7/23/2001 13:53'! position: aPoint | lePoint | lePoint_aPoint copy. (owner class = CellulePageMorph) ifTrue:[ (owner gridAuto) ifTrue: [ lePoint setX:(lePoint x -self owner left// owner gridX * owner gridX + self owner left) setY:(lePoint y -self owner top // owner gridY * owner gridY+ self owner top).]. ]. super position: lePoint.! ! CelluleImageMorph subclass: #CelluleImageSurvoleeMorph instanceVariableNames: 'source2 image2 ' classVariableNames: '' poolDictionaries: '' category: 'nightMareWeaverVersion1'! !CelluleImageSurvoleeMorph commentStamp: '' prior: 0! ! !CelluleImageSurvoleeMorph methodsFor: 'event handling' stamp: 'vince 7/19/2001 12:07'! handlesMouseOver: evt ^true.! ! !CelluleImageSurvoleeMorph methodsFor: 'event handling' stamp: 'vince 7/19/2001 12:10'! mouseEnter: evt | tmp | super mouseEnter:evt. tmp_ image. image_ image2. image2_ tmp. self changed.! ! !CelluleImageSurvoleeMorph methodsFor: 'event handling' stamp: 'vince 7/19/2001 12:24'! mouseLeave: evt | tmp | super mouseLeave:evt. tmp_ image. image_ image2. image2_ tmp. self changed.! ! !CelluleImageSurvoleeMorph methodsFor: 'other' stamp: 'vince 7/19/2001 12:32'! drawImage: aForm on: aCanvas "Draw the given form onto the canvas using the Balloon 3D engine" | engine | engine _ (B3DRenderEngine defaultForPlatformOn: aCanvas form). engine == nil ifTrue:[^self]. "Setup the engine" engine viewport: aCanvas form boundingBox. "Install the material to be used (using a plain white emission color)" engine material: (B3DMaterial new emission: Color white). "Install the texture" engine texture: aForm. "Draw the mesh" engine render: (B3DIndexedQuadMesh new plainTextureRect). "and finish" engine finish.! ! !CelluleImageSurvoleeMorph methodsFor: 'accessing' stamp: 'vince 7/19/2001 11:46'! image2 ^image2.! ! !CelluleImageSurvoleeMorph methodsFor: 'accessing' stamp: 'vince 7/19/2001 11:46'! image2: unForm image2_ unForm! ! !CelluleImageSurvoleeMorph methodsFor: 'accessing' stamp: 'vince 7/19/2001 11:45'! source2 ^source2.! ! !CelluleImageSurvoleeMorph methodsFor: 'accessing' stamp: 'vince 7/19/2001 11:47'! source2: unnom source2_ unnom! ! !CelluleImageSurvoleeMorph methodsFor: 'printing' stamp: 'vince 7/23/2001 13:43'! ecrireCellule: monHtml "Žcrit le code html relatif ˆ la cellule dans un stream FichierHtml" monHtml command:('a href="', self lien,'" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(''',self source ,''','''',''', self source2,''',1)"'). monHtml command:('IMG name=',self source,' src=', self source,' width=',self extent x printString,' height=',self extent y printString,' border=0'). monHtml command:'/a'. ! ! "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "! CelluleImageSurvoleeMorph class instanceVariableNames: ''! !CelluleImageSurvoleeMorph class methodsFor: 'instance creation' stamp: 'vince 7/19/2001 15:16'! avec: celluleImage survolee: celluleImage2 "fabrique un rollover ˆ partir de 2 celluleImageMorphs." | cel | cel_self new initialize. cel source: celluleImage source. celluleImage lien='' ifTrue:[cel lien: (FillInTheBlank request:'Entrez la cible du lien' initialAnswer:'http://www.ajt.fr').] ifFalse:[cel lien: celluleImage lien]. cel image: celluleImage image. cel position: celluleImage position. cel source2: celluleImage2 source. cel image2:( Form extent: celluleImage bounds extent depth: celluleImage image depth). cel drawImage: celluleImage2 image on: (cel image2 getCanvas). ^cel.! ! PasteUpMorph subclass: #CellulePageMorph instanceVariableNames: 'nom couleurTexte couleurLien couleurLienA couleurLienV titre auteur description motsCles souligne background bgform gridAuto gridX gridY ' classVariableNames: '' poolDictionaries: '' category: 'nightMareWeaverVersion1'! !CellulePageMorph commentStamp: '' prior: 0! Une cellulePageMorph reprŽsente la page HTML que l'on veut produire. CellulePageMorph new initialize openInWorld.! !CellulePageMorph methodsFor: 'accessing' stamp: 'vince 7/11/2001 16:07'! auteur ^auteur! ! !CellulePageMorph methodsFor: 'accessing' stamp: 'vince 7/11/2001 16:05'! auteur: unNom auteur_unNom.! ! !CellulePageMorph methodsFor: 'accessing' stamp: 'vince 7/16/2001 15:34'! background ^background! ! !CellulePageMorph methodsFor: 'accessing' stamp: 'vince 7/16/2001 15:34'! background: unfichier background_ unfichier! ! !CellulePageMorph methodsFor: 'accessing' stamp: 'vince 7/17/2001 15:01'! bgform: aValue. bgform_ aValue.! ! !CellulePageMorph methodsFor: 'accessing' stamp: 'vince 7/11/2001 16:04'! couleurLien ^couleurLien! ! !CellulePageMorph methodsFor: 'accessing' stamp: 'vince 7/11/2001 16:03'! couleurLien: uneCouleur couleurLien_uneCouleur.! ! !CellulePageMorph methodsFor: 'accessing' stamp: 'vince 7/11/2001 16:04'! couleurLienA ^couleurLienA! ! !CellulePageMorph methodsFor: 'accessing' stamp: 'vince 7/11/2001 16:03'! couleurLienA: uneCouleur couleurLienA_uneCouleur.! ! !CellulePageMorph methodsFor: 'accessing' stamp: 'vince 7/11/2001 16:04'! couleurLienV ^couleurLienV! ! !CellulePageMorph methodsFor: 'accessing' stamp: 'vince 7/11/2001 16:04'! couleurLienV: uneCouleur couleurLienV_uneCouleur.! ! !CellulePageMorph methodsFor: 'accessing' stamp: 'vince 7/11/2001 16:04'! couleurTexte ^couleurTexte! ! !CellulePageMorph methodsFor: 'accessing' stamp: 'vince 7/11/2001 16:03'! couleurTexte: uneCouleur couleurTexte_uneCouleur.! ! !CellulePageMorph methodsFor: 'accessing' stamp: 'vince 7/11/2001 16:06'! description ^description! ! !CellulePageMorph methodsFor: 'accessing' stamp: 'vince 7/11/2001 16:06'! description: uneDescription description_uneDescription.! ! !CellulePageMorph methodsFor: 'accessing' stamp: 'vince 7/17/2001 14:56'! gridAuto ^gridAuto! ! !CellulePageMorph methodsFor: 'accessing' stamp: 'vince 7/17/2001 14:58'! gridAuto: unBooleen gridAuto_unBooleen.! ! !CellulePageMorph methodsFor: 'accessing' stamp: 'vince 7/17/2001 14:56'! gridX ^gridX! ! !CellulePageMorph methodsFor: 'accessing' stamp: 'vince 7/17/2001 14:57'! gridX: unentier gridX_ unentier.! ! !CellulePageMorph methodsFor: 'accessing' stamp: 'vince 7/17/2001 14:56'! gridY ^gridY! ! !CellulePageMorph methodsFor: 'accessing' stamp: 'vince 7/17/2001 14:57'! gridY: unentier gridY_ unentier.! ! !CellulePageMorph methodsFor: 'accessing' stamp: 'vince 7/11/2001 16:07'! motsCles ^motsCles! ! !CellulePageMorph methodsFor: 'accessing' stamp: 'vince 7/11/2001 16:08'! motsCles: uneListe motsCles_uneListe! ! !CellulePageMorph methodsFor: 'accessing' stamp: 'vince 7/18/2001 10:46'! nom ^nom! ! !CellulePageMorph methodsFor: 'accessing' stamp: 'vince 7/18/2001 10:47'! nom: unNom nom_unNom.! ! !CellulePageMorph methodsFor: 'accessing' stamp: 'vince 7/16/2001 14:43'! souligne ^souligne.! ! !CellulePageMorph methodsFor: 'accessing' stamp: 'vince 7/16/2001 14:28'! souligne: unBool souligne_unBool.! ! !CellulePageMorph methodsFor: 'accessing' stamp: 'vince 7/11/2001 16:07'! titre ^titre! ! !CellulePageMorph methodsFor: 'accessing' stamp: 'vince 7/11/2001 16:05'! titre: unTitre titre_ unTitre.! ! !CellulePageMorph methodsFor: 'dropping/grabbing' stamp: 'vince 7/23/2001 08:16'! acceptDroppingMorph: aMorph event:evt "self addMorph: aMorph." super acceptDroppingMorph: aMorph event:evt! ! !CellulePageMorph methodsFor: 'dropping/grabbing' stamp: 'vince 7/23/2001 07:57'! handlesMouseDown: evt ^super handlesMouseDown:evt.! ! !CellulePageMorph methodsFor: 'dropping/grabbing' stamp: 'vince 7/23/2001 07:59'! mouseDown: evt super mouseDown:evt. evt yellowButtonPressed ifTrue: [^ self yellowButtonActivity: evt].! ! !CellulePageMorph methodsFor: 'dropping/grabbing' stamp: 'vince 7/17/2001 10:40'! wantsDroppedMorph: aMorph event:evt "On n'accepte que deux types de morphs" ^((aMorph class=CelluleImageMorph) | (aMorph class=CelluleTextMorph)).! ! !CellulePageMorph methodsFor: 'menu commands' stamp: 'vince 7/11/2001 18:49'! ajouterTexte: evt | cel | cel_CelluleTextMorph new initialize. cel setNewContentsFrom: 'texte ˆ insŽrer'. evt hand attachMorph:cel.! ! !CellulePageMorph methodsFor: 'menu commands' stamp: 'vince 7/17/2001 11:42'! annulerDecoupage | col aAjouter | self removeAllMorphsIn:(self submorphs select:[:each | each class=CelluleVideMorph]). col_self submorphs select:[:each | each class=CellulePageMorph]. aAjouter_OrderedCollection new. col do:[:sub | aAjouter addAll:(sub submorphs select:[:each | each class ~= CelluleVideMorph])]. self removeAllMorphsIn: col. self addAllMorphs: aAjouter. ! ! !CellulePageMorph methodsFor: 'menu commands' stamp: 'vince 7/12/2001 04:32'! decoupage | l | l_self decoupeEnLigne. l do:[:each | self decoupeLaLigne:each].! ! !CellulePageMorph methodsFor: 'menu commands' stamp: 'vince 7/18/2001 10:49'! ecrireHtml | monHtml | self nom:(FillInTheBlankMorph request:'nom du fichier' initialAnswer: nom). monHtml _ FichierHtml newFrom: (FileStream newFileNamed: nom). self ecrireEnTete: monHtml. self ecrireCellule: monHtml. self ecrireFin:monHtml. monHtml close. ! ! !CellulePageMorph methodsFor: 'menu commands' stamp: 'vince 7/17/2001 16:06'! fenetreGrille | sw s p a but | sw_SystemWindow labelled:'proprietes de la grille'. sw model: self;color: Color lightGray. "gridX" s_StringMorph new contents:'Maillage horizontal'. p_PluggableTextMorph on:self text:#maillageX accept:#changeGridX: . p acceptOnCR: true; hideScrollBarIndefinitely. a_AlignmentMorph newRow color: Color veryLightGray. a addMorphBack:(AlignmentMorph newSpacer: Color transparent); addMorphBack: s. a hResizing: #spaceFill;vResizing: #spaceFill. sw addMorph:a frame:(0@0 corner: 0.5@0.4). sw addMorph:p frame:(0.5@0 corner: 1@0.4). "gridY" s_StringMorph new contents:'Maillage vertical'. p_PluggableTextMorph on:self text:#maillageY accept:#changeGridY: . p acceptOnCR: true; hideScrollBarIndefinitely. a_AlignmentMorph newRow color: Color veryLightGray. a addMorphBack:(AlignmentMorph newSpacer: Color transparent); addMorphBack: s. a hResizing: #spaceFill;vResizing: #spaceFill. sw addMorph:a frame:(0@0.4 corner: 0.5@0.8). sw addMorph:p frame:(0.5@0.4 corner: 1@0.8). "divers..." a_AlignmentMorph newRow color: Color transparent. but_ToggleButtonMorph radioButton. but target: self ;actionSelector:#radioGridAuto ;actWhen: #buttonDown ;stateSelector: #gridAuto; setInitialState. s_StringMorph new contents:'grille automatique ? '. a addMorphBack:(AlignmentMorph newSpacer: Color transparent) ;addMorphBack: s ;addMorphBack: but; addMorphBack:(AlignmentMorph newSpacer: Color transparent). sw addMorph:a frame:(0@0.8 corner: 1@1). sw openInWorldExtent: 250@130.! ! !CellulePageMorph methodsFor: 'menu commands' stamp: 'vince 7/17/2001 16:18'! fenetreProprietes | sw s p a s2 q a2 pop but | sw_SystemWindow labelled:'proprietes'. sw model: self;color: Color lightGray. "titre" s_StringMorph new contents:'Titre:'. p_PluggableTextMorph on:self text:#titre accept:#changeLeTitre: . p acceptOnCR: true; hideScrollBarIndefinitely. p extent: (sw extent x // 2)@(sw extent y//10 - 5) . a_AlignmentMorph newRow color: Color veryLightGray. a addMorphBack:(AlignmentMorph newSpacer: Color transparent); addMorphBack: s. a hResizing: #spaceFill;vResizing: #spaceFill. sw addMorph:a frame:(0@0 corner: 0.25@0.1). sw addMorph:p frame:(0.25@0 corner: 1@0.1). "auteur" s_StringMorph new contents:'Auteur:'. p_PluggableTextMorph on:self text:#auteur accept:#changeLAuteur: . p acceptOnCR: true; hideScrollBarIndefinitely. a_AlignmentMorph newRow color: Color veryLightGray. a addMorphBack:(AlignmentMorph newSpacer: Color transparent); addMorphBack: s. a hResizing: #spaceFill;vResizing: #spaceFill. sw addMorph:a frame:(0@0.1 corner: 0.25@0.2). sw addMorph:p frame:(0.25@0.1 corner: 1@0.2). "description" s_StringMorph new contents:'Description:'. p_PluggableTextMorph on:self text:#description accept:#changeLaDescription: . p acceptOnCR: true; hideScrollBarIndefinitely. a_AlignmentMorph newRow color: Color veryLightGray. a addMorphBack:(AlignmentMorph newSpacer: Color transparent); addMorphBack: s. a hResizing: #spaceFill;vResizing: #spaceFill. sw addMorph:a frame:(0@0.2 corner: 0.25@0.3). sw addMorph:p frame:(0.25@0.2 corner: 1@0.3). "motsCles" s_StringMorph new contents:'Mots-clŽ:'. p_PluggableTextMorph on:self text:#motsCles accept:#changeMotsCles: . p acceptOnCR: true; hideScrollBarIndefinitely. a_AlignmentMorph newRow color: Color veryLightGray. a addMorphBack:(AlignmentMorph newSpacer: Color transparent); addMorphBack: s. a hResizing: #spaceFill;vResizing: #spaceFill. sw addMorph:a frame:(0@0.3 corner: 0.25@0.4). sw addMorph:p frame:(0.25@0.3 corner: 1@0.4). "taille" s_StringMorph new contents:'Taille:'. s2_StringMorph new contents:'@'. p_PluggableTextMorph on:self text:#tailleX accept:#tailleX: . p acceptOnCR: true; hideScrollBarIndefinitely. q_PluggableTextMorph on:self text:#tailleY accept:#tailleY: . q acceptOnCR: true; hideScrollBarIndefinitely. a_AlignmentMorph newRow color: Color veryLightGray. a addMorphBack:(AlignmentMorph newSpacer: Color transparent); addMorphBack: s. a hResizing: #spaceFill;vResizing: #spaceFill. a2_AlignmentMorph newRow color: Color veryLightGray. a2 addMorphBack:(AlignmentMorph newSpacer: Color transparent); addMorphBack: s2;addMorphBack:(AlignmentMorph newSpacer: Color transparent). a2 hResizing: #spaceFill;vResizing: #spaceFill. sw addMorph:a frame:(0@0.4 corner: 0.25@0.5). sw addMorph:p frame:(0.25@0.4 corner: 0.55@0.5). sw addMorph:a2 frame:(0.55@0.4 corner:0.70@0.5). sw addMorph:q frame:(0.70@0.4 corner:1@0.5). "couleur Texte" s_StringMorph new contents:'Couleur du texte:'. pop_PopUpChoiceMorph new. pop contents: 'dans la liste...';target:self; getItemsSelector:#listeCouleurs;actionSelector:#changeCouleurTexte:. but_SimpleButtonMorph new initializeWithLabel: 'pipette...' ;fitContents. but target: self ;actionSelector: #changeCouleurTextePipette. but actWhen: #buttonUp. a_AlignmentMorph newRow color: Color veryLightGray. a addMorphBack: s. a hResizing: #spaceFill;vResizing: #spaceFill. a addMorphBack:(AlignmentMorph newSpacer: Color transparent); addMorphBack: pop. a addMorphBack:(AlignmentMorph newSpacer: Color transparent); addMorphBack: but. sw addMorph:a frame:(0@0.5 corner: 1@0.6). "couleur liens" s_StringMorph new contents:'Couleur des liens:'. pop_PopUpChoiceMorph new. pop contents: 'dans la liste...';target:self; getItemsSelector:#listeCouleurs;actionSelector:#changeCouleurLien:. but_SimpleButtonMorph new initializeWithLabel: 'pipette...' ;fitContents. but target: self ;actionSelector: #changeCouleurLienPipette. but actWhen: #buttonUp. a_AlignmentMorph newRow color: Color veryLightGray. a addMorphBack: s. a hResizing: #spaceFill;vResizing: #spaceFill. a addMorphBack:(AlignmentMorph newSpacer: Color transparent); addMorphBack: pop. a addMorphBack:(AlignmentMorph newSpacer: Color transparent); addMorphBack: but. sw addMorph:a frame:(0@0.6 corner: 1@0.7). "couleur liens actifs" s_StringMorph new contents:'Couleur des liens actifs:'. pop_PopUpChoiceMorph new. pop contents: 'dans la liste...';target:self; getItemsSelector:#listeCouleurs;actionSelector:#changeCouleurLienA:. but_SimpleButtonMorph new initializeWithLabel: 'pipette...' ;fitContents. but target: self ;actionSelector: #changeCouleurLienAPipette. but actWhen: #buttonUp. a_AlignmentMorph newRow color: Color veryLightGray. a addMorphBack: s. a hResizing: #spaceFill;vResizing: #spaceFill. a addMorphBack:(AlignmentMorph newSpacer: Color transparent); addMorphBack: pop. a addMorphBack:(AlignmentMorph newSpacer: Color transparent); addMorphBack: but. sw addMorph:a frame:(0@0.7 corner: 1@0.8). "couleur liens visites" s_StringMorph new contents:'Couleur des liens visitŽs:'. pop_PopUpChoiceMorph new. pop contents: 'dans la liste...';target:self; getItemsSelector:#listeCouleurs;actionSelector:#changeCouleurLienV:. but_SimpleButtonMorph new initializeWithLabel: 'pipette...' ;fitContents. but target: self ;actionSelector: #changeCouleurLienVPipette. but actWhen: #buttonUp. a_AlignmentMorph newRow color: Color veryLightGray. a addMorphBack: s. a hResizing: #shrinkWrap;vResizing: #spaceFill. a addMorphBack:(AlignmentMorph newSpacer: Color transparent); addMorphBack: pop. a addMorphBack:(AlignmentMorph newSpacer: Color transparent); addMorphBack: but. sw addMorph:a frame:(0@0.8 corner: 1@0.9). "divers..." a_AlignmentMorph newRow color: Color transparent. but_ToggleButtonMorph radioButton. but target: self ;actionSelector:#radioSouligne ;actWhen: #buttonDown; stateSelector: #souligne; setInitialState. s_StringMorph new contents:'souligner les liens? '. a addMorphBack:(AlignmentMorph newSpacer: Color transparent);addMorphBack: s ;addMorphBack: but;addMorphBack:(AlignmentMorph newSpacer: Color transparent). sw addMorph:a frame:(0@0.9 corner: 1@1). sw openInWorldExtent: 450@385.! ! !CellulePageMorph methodsFor: 'menu commands' stamp: 'vince 7/16/2001 17:59'! retirerArrierePlan background_nil. bgform_nil. self changed.! ! !CellulePageMorph methodsFor: 'menu' stamp: 'vince 7/17/2001 15:11'! leMenu:evt | menu | menu_MenuMorph new. menu add: 'x fermer' target: menu action: #delete. menu addLine. menu add: 'ajouter un texte' target: self selector: #ajouterTexte: argument: evt. menu add: 'ajouter une image' target: ImageFileList action:#openCelluleImageFileList. menu addLine. menu add: 'ecrire la page' target: self action:#ecrireHtml. menu add: 'nettoyer la page' target: self action:#annulerDecoupage. menu addLine. menu add:'propriŽtŽs de la page' target:self action:#fenetreProprietes. background ifNotNil:[menu add:'retirer l''arrire-plan' target:self action:#retirerArrierePlan.]. menu add:'propriŽtŽs de la grille' target: self action: #fenetreGrille. menu position: evt cursorPoint. menu openInWorld.! ! !CellulePageMorph methodsFor: 'menu' stamp: 'vince 7/11/2001 17:16'! yellowButtonActivity: evt self leMenu: evt.! ! !CellulePageMorph methodsFor: 'initialization' stamp: 'vince 7/23/2001 13:49'! initialize super initialize. self nom: 'sansTitre.html'. self couleurTexte: Color black. self couleurLien: Color blue. self couleurLienA: Color red. self couleurLienV: Color magenta. self color: Color white. self auteur: ''. self description:''. self titre:''. self motsCles:''. self souligne: true. self gridX:1. self gridY:1. self gridAuto: false. self background:nil. self bgform:nil. self extent: 800@600. self center: World extent//2. self enableDragNDrop. self clipSubmorphs: true. ! ! !CellulePageMorph methodsFor: 'drawing' stamp: 'vince 7/16/2001 17:45'! drawOn: aCanvas bgform ifNotNil:[aCanvas image: bgform at: bounds origin] ifNil:[super drawOn: aCanvas].! ! !CellulePageMorph methodsFor: 'action' stamp: 'vince 7/12/2001 08:40'! decoupeEnLigne "decoupe la page en lignes pour la transformer en tableau" | lesLignes laMatrice o temp lesBlocs | lesLignes_SortedCollection new. lesBlocs_SortedCollection new sortBlock: [:i :j| i top <= j top ]. lesBlocs addAll: submorphs. lesBlocs do:[:cel | (lesLignes size=0) ifTrue:[lesLignes add: cel top; add:cel bottom] ifFalse:[ (cel top <= lesLignes last) ifTrue:[temp_lesLignes last. lesLignes removeLast. lesLignes add: (cel bottom max: temp)] ifFalse:[lesLignes add: cel top; add:cel bottom]]]. lesLignes add: self top. lesLignes_ lesLignes asSet asSortedCollection. laMatrice_OrderedCollection new. (1 to: lesLignes size-1) do: [:i | o_OrderedCollection new . o add:(lesLignes at:i). o add:(lesLignes at:i+1). laMatrice add: o]. ^laMatrice! ! !CellulePageMorph methodsFor: 'action' stamp: 'vince 7/12/2001 04:30'! decoupeLaLigne: uneLigne "decoupe la ligne selon les cellules qui la compose" | lesBlocsDeLaLigne pointCourant lesBlocsVides laZone blocsACheval p nouveauxBlocs block | "init des collections" block_[:i :j| i left <= j left ]. lesBlocsDeLaLigne_SortedCollection new sortBlock:block. nouveauxBlocs_SortedCollection new sortBlock:block. lesBlocsVides_SortedCollection new sortBlock:block. "on y ajoute toutes les cellules de la lignes de gauche ˆ droite." lesBlocsDeLaLigne addAll: (self submorphs select: [:cel| (cel top>= (uneLigne at:1)) & (cel bottom<= (uneLigne at:2))] ). "on se place dans le coin h-g de la ligne" pointCourant_ self left@(uneLigne at:1). "debut modif" [pointCourant x = zone x &(bloc left <= zone y) ifTrue:[zone setX: zone x setY:(zone y max: bloc right) ].zone ]. "on collecte les blocs de la zone" blocsACheval addAll:(lesBlocsDeLaLigne select: [:bl | bl left >= laZone x &(bl left <= laZone y)]). "on cree une sous-page" self removeAllMorphsIn: blocsACheval. p_CellulePageMorph new bounds:(laZone x@(uneLigne at: 1) corner:laZone y@(uneLigne at: 2)). p addAllMorphs: blocsACheval. self addMorph: p. lesBlocsDeLaLigne removeAll: blocsACheval. "on se positionne a la fin de la zone" pointCourant setX: laZone y setY: pointCourant y. ] ] ]. lesBlocsVides do:[:b | self addMorph: b].! ! !CellulePageMorph methodsFor: 'action' stamp: 'vince 7/17/2001 10:48'! dessineFond: aMorph "met en place l'arrire plan de la page" | aImage patternBox targetBox map aForm | aForm _Form fromBinaryStream:(FileStream readOnlyFileNamed: aMorph source). aImage _ Form extent: self extent depth: Display depth. patternBox _ aForm boundingBox. targetBox _ aImage boundingBox. map _ aForm colormapIfNeededForDepth: aImage depth. targetBox left to: targetBox right - 1 by: patternBox width do: [:x | targetBox top to: targetBox bottom - 1 by: patternBox height do: [:y | aImage copyBits: patternBox from: aForm at: x @ y colorMap: map ]]. self background: aMorph source. aMorph delete. bgform_ aImage. self changed.! ! !CellulePageMorph methodsFor: 'updates from window' stamp: 'vince 7/16/2001 13:55'! changeCouleurLien: unSymb self couleurLien: (Color perform: unSymb) ! ! !CellulePageMorph methodsFor: 'updates from window' stamp: 'vince 7/16/2001 14:10'! changeCouleurLienA: unSymb self couleurLienA: (Color perform: unSymb) ! ! !CellulePageMorph methodsFor: 'updates from window' stamp: 'vince 7/16/2001 14:11'! changeCouleurLienAPipette self changeColorTarget: self selector: #couleurLienA: originalColor: self couleurLienA hand: self activeHand.! ! !CellulePageMorph methodsFor: 'updates from window' stamp: 'vince 7/16/2001 13:56'! changeCouleurLienPipette self changeColorTarget: self selector: #couleurLien: originalColor: self couleurLien hand: self activeHand.! ! !CellulePageMorph methodsFor: 'updates from window' stamp: 'vince 7/16/2001 14:11'! changeCouleurLienV: unSymb self couleurLienV: (Color perform: unSymb) ! ! !CellulePageMorph methodsFor: 'updates from window' stamp: 'vince 7/16/2001 14:11'! changeCouleurLienVPipette self changeColorTarget: self selector: #couleurLienV: originalColor: self couleurLienV hand: self activeHand.! ! !CellulePageMorph methodsFor: 'updates from window' stamp: 'vince 7/16/2001 13:18'! changeCouleurTexte: unSymb self couleurTexte: (Color perform: unSymb) ! ! !CellulePageMorph methodsFor: 'updates from window' stamp: 'vince 7/16/2001 13:47'! changeCouleurTextePipette self changeColorTarget: self selector: #couleurTexte: originalColor: self couleurTexte hand: self activeHand.! ! !CellulePageMorph methodsFor: 'updates from window' stamp: 'vince 7/17/2001 15:32'! changeGridX: aText gridX_aText asNumber. ^true.! ! !CellulePageMorph methodsFor: 'updates from window' stamp: 'vince 7/17/2001 15:34'! changeGridY: aText gridY_aText asNumber. ^true.! ! !CellulePageMorph methodsFor: 'updates from window' stamp: 'vince 7/16/2001 11:17'! changeLAuteur: unauteur unauteur ifNotNil:[ self auteur: unauteur asString.^true].! ! !CellulePageMorph methodsFor: 'updates from window' stamp: 'vince 7/16/2001 11:18'! changeLaDescription:uneDesc uneDesc ifNotNil:[ self description: uneDesc asString.^true].! ! !CellulePageMorph methodsFor: 'updates from window' stamp: 'vince 7/12/2001 11:12'! changeLeTitre: untitre untitre ifNotNil:[ self titre: untitre asString.^true].! ! !CellulePageMorph methodsFor: 'updates from window' stamp: 'vince 7/16/2001 11:19'! changeMotsCles: desMots desMots ifNotNil:[ self motsCles: desMots asString.^true].! ! !CellulePageMorph methodsFor: 'updates from window' stamp: 'vince 7/16/2001 13:16'! listeCouleurs ^Color colorNames! ! !CellulePageMorph methodsFor: 'updates from window' stamp: 'vince 7/17/2001 15:20'! maillageX ^gridX printString.! ! !CellulePageMorph methodsFor: 'updates from window' stamp: 'vince 7/17/2001 15:20'! maillageY ^gridY printString.! ! !CellulePageMorph methodsFor: 'updates from window' stamp: 'vince 7/17/2001 15:48'! radioGridAuto gridAuto_gridAuto not! ! !CellulePageMorph methodsFor: 'updates from window' stamp: 'vince 7/17/2001 15:49'! radioSouligne souligne_souligne not! ! !CellulePageMorph methodsFor: 'updates from window' stamp: 'vince 7/16/2001 11:46'! tailleX ^self extent x printString.! ! !CellulePageMorph methodsFor: 'updates from window' stamp: 'vince 7/16/2001 11:49'! tailleX: untruc untruc ifNotNil:[ self extent: (untruc asNumber)@(self extent y).^true] ! ! !CellulePageMorph methodsFor: 'updates from window' stamp: 'vince 7/16/2001 11:46'! tailleY ^self extent y printString.! ! !CellulePageMorph methodsFor: 'updates from window' stamp: 'vince 7/16/2001 11:48'! tailleY: untruc untruc ifNotNil:[ self extent: (self extent x)@(untruc asNumber).^true] ! ! !CellulePageMorph methodsFor: 'printing' stamp: 'vince 7/12/2001 08:38'! ecrireCellule: monHtml self decoupeEnLigne do:[:l|self decoupeLaLigne: l]. self ecrireCorps: monHtml. ! ! !CellulePageMorph methodsFor: 'printing' stamp: 'vince 7/12/2001 05:09'! ecrireCorps: monHtml "Žcrit le corps du document dans le fichierHtml" | cr dico col | cr _ String with: Character cr. col_SortedCollection new. dico_self organiserLesBlocs. dico keys do: [:k | col add: k]. col do:[ :cle |monHtml command: 'TABLE width=',self extent x printString,' height=',(dico at: cle) first extent y printString,' borderwidth=0 cellspacing=0 cellpadding=0'; verbatim: cr. monHtml command: 'tr'; verbatim: cr. (dico at: cle) do:[:b| monHtml command: ('td width=', b extent x printString,' height=',b extent y printString). b ecrireCellule: monHtml. monHtml command: '/td'; verbatim: cr. ]. monHtml command: '/tr'; verbatim: cr. monHtml command: '/table'; verbatim: cr. ]. ! ! !CellulePageMorph methodsFor: 'printing' stamp: 'vince 7/19/2001 15:00'! ecrireEnTete: monHtml "Žcrit l'en-tete du document dans le fichierHtml" | cr truc | cr _ String with: Character cr. monHtml command: 'HTML'; verbatim: cr. monHtml command: 'HEAD'; verbatim: cr. monHtml command: 'META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"';verbatim: cr. monHtml command: 'META NAME="Description" CONTENT="',self description,'"'; verbatim: cr. monHtml command: 'META NAME="Keywords" CONTENT="',self motsCles,'"';verbatim: cr. monHtml command: 'META NAME="Author" CONTENT="',self auteur,'"'; verbatim: cr. monHtml command: 'TITLE'. monHtml nextPutAll: self titre. monHtml command: '/TITLE'; verbatim: cr. souligne ifFalse:[ monHtml command:'style'. monHtml command:'!!-- a{text-decoration:none} //--'. monHtml command:'/style';verbatim: cr.]. truc_self submorphs detect:[:cel|cel class = CelluleImageSurvoleeMorph] ifNone:[nil]. truc ifNotNil:[ self ecrireRollOver: monHtml.]. monHtml command: '/HEAD'; verbatim: cr. self parametresBody: monHtml! ! !CellulePageMorph methodsFor: 'printing' stamp: 'vince 7/12/2001 05:06'! ecrireFin: monHtml "Žcrit la fin du document dans le fichierHtml" | cr | cr _ String with: Character cr. monHtml command: '/BODY'; verbatim: cr. monHtml command: '/HTML'; verbatim: cr. ! ! !CellulePageMorph methodsFor: 'printing' stamp: 'vince 7/19/2001 15:04'! ecrireRollOver: monHtml "Žcrit les JavaScripts pour faire des roll-over dans le fichierHtml" | cr | cr _ String with: Character cr. monHtml command:'script language="JavaScript"';verbatim: cr. monHtml verbatim: '0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!!x&&i'; verbatim: cr. monHtml command: '/script'; verbatim: cr. ! ! !CellulePageMorph methodsFor: 'printing' stamp: 'vince 7/12/2001 05:11'! organiserLesBlocs "range les blocs dans le bon ordre: de haut en bas et de gauche a droite" | lignesOrdonnees | lignesOrdonnees_Dictionary new. self submorphs do:[:b| (lignesOrdonnees includesKey: b top) ifFalse:[lignesOrdonnees at: b top put:(SortedCollection sortBlock: [:i :j | i left <= j left]).]. (lignesOrdonnees at: b top) add: b.]. ^lignesOrdonnees. ! ! !CellulePageMorph methodsFor: 'printing' stamp: 'vince 7/19/2001 14:56'! parametresBody: unStream "on Žcrit les couleurs, l'image d'arrire plan..." | colfond coltexte collien collienv colliena maString cr chainePreload celSur | cr_String with: Character cr. colfond_(self color pixelValueForDepth: 32) radix: 16. colfond_colfond copyFrom:6 to: colfond size. colfond padded: #left to: colfond size+1 with:$#. coltexte_(self couleurTexte pixelValueForDepth: 32) radix: 16. coltexte _coltexte copyFrom:6 to: coltexte size. coltexte padded: #left to: coltexte size+1 with:$#. collien_(self couleurLien pixelValueForDepth: 32) radix: 16. collien_collien copyFrom:6 to: collien size. collien padded: #left to: collien size+1 with:$#. collienv_(self couleurLienV pixelValueForDepth: 32) radix: 16. collienv_collienv copyFrom:6 to: collienv size. collienv padded: #left to: collienv size+1 with:$#. colliena_(self couleurLienA pixelValueForDepth: 32) radix: 16. colliena _colliena copyFrom:6 to: colliena size. colliena padded: #left to: colliena size+1 with:$#. chainePreload_' onLoad="MM_preloadImages('. celSur_self submorphs select: [:cel| cel class = (CelluleImageSurvoleeMorph)]. celSur size >0 ifTrue:[celSur do:[:cel | chainePreload_chainePreload,'''',cel source2,''',']. chainePreload at: chainePreload size put: $). chainePreload_chainePreload ,'"'] ifFalse:[chainePreload_'']. maString_'BODY ','BGCOLOR=',colfond. background ifNotNil:[maString_maString,' BACKGROUND=',self background]. maString_maString,' TEXT=',coltexte,' LINK=',collien,' VLINK=',collienv,' ALINK=', colliena,chainePreload. unStream command: maString;verbatim: cr. ! ! TextMorph subclass: #CelluleTextMorph instanceVariableNames: 'liens ' classVariableNames: '' poolDictionaries: '' category: 'nightMareWeaverVersion1'! !CelluleTextMorph commentStamp: '' prior: 0! permet d'encapsuler un texte dans une cellule pour l'ajouter ˆ une cellulePageMorph.! !CelluleTextMorph methodsFor: 'accessing' stamp: 'vince 7/11/2001 15:54'! liens ^liens.! ! !CelluleTextMorph methodsFor: 'dropping/grabbing' stamp: 'vince 7/11/2001 18:26'! handlesMouseDown: evt ^super handlesMouseDown:evt.! ! !CelluleTextMorph methodsFor: 'dropping/grabbing' stamp: 'vince 7/17/2001 11:01'! justDroppedInto:aMorph event:evt "on donne au texte la couleur du texte de la page." super justDroppedInto: aMorph event:evt. (aMorph class = CellulePageMorph) ifTrue: [self color: (aMorph couleurTexte).] ! ! !CelluleTextMorph methodsFor: 'dropping/grabbing' stamp: 'vince 7/11/2001 18:23'! mouseDown: evt evt yellowButtonPressed ifTrue: [^ self yellowButtonActivity: evt] ifFalse:[super mouseDown:evt]! ! !CelluleTextMorph methodsFor: 'initialization' stamp: 'vince 7/11/2001 15:56'! initialize super initialize. liens_Dictionary new.! ! !CelluleTextMorph methodsFor: 'menu commands' stamp: 'vince 7/11/2001 18:57'! ajouterLien | monUrl sel | sel_self editor selectionInterval copy. monUrl_FillInTheBlank request:'Entrez l''url' initialAnswer:'http://www.ajt.fr'. self liens add: sel->monUrl.! ! !CelluleTextMorph methodsFor: 'menu commands' stamp: 'vince 7/17/2001 11:02'! ajouterPolice | font nom | "permet d'ajouter des polices; c'est pas trs joli mais a marche..." font_FillInTheBlank request:'Entrez l''emplacement de la police TTF' initialAnswer:'c:\windows\fonts\Lucon.ttf'. nom_FillInTheBlank request:'Entrez le nom de la police' initialAnswer:'Lucida Console'. TTFontReader installTTF: font asTextStyle: nom asSymbol sizes: #(9 14 19 24 29 34 39). ! ! !CelluleTextMorph methodsFor: 'menu' stamp: 'vince 7/12/2001 09:03'! leMenu:evt | menu | menu_MenuMorph new. menu add: 'x fermer' target: menu action: #delete. menu addLine. menu add: 'taille' target: self action:#chooseFont. menu add: 'police' target: self action:#chooseStyle. menu add: 'alignement' target: self action:#chooseAlignment. menu add: 'emphasis' target: self action: #chooseEmphasis. menu add: 'lien' target: self action: #ajouterLien. menu addLine. menu add: 'ajouter une police' target: self action: #ajouterPolice. menu position: (Sensor mousePoint);openInWorld.! ! !CelluleTextMorph methodsFor: 'menu' stamp: 'vince 7/11/2001 18:23'! yellowButtonActivity: evt self leMenu: evt.! ! !CelluleTextMorph methodsFor: 'printing' stamp: 'vince 7/17/2001 11:03'! alignementHtml "parser pour l'alignement d'une cellule." (self textStyle alignment=0) ifTrue:[^'left']. (self textStyle alignment=1) ifTrue:[^'right']. (self textStyle alignment=2) ifTrue:[^'center']. (self textStyle alignment=3) ifTrue:[^'justify']. ! ! !CelluleTextMorph methodsFor: 'printing' stamp: 'vince 7/17/2001 11:03'! balisageTexte: monHtml "Žcrit le texte en y insŽrant les balises nŽcessaires." | compteur tableau temp collec val temp2 | compteur_1. tableau_self text runs copy. self liens keysDo: [:k | temp_ tableau copyFrom:(k first) to:(k last). temp runsAndValuesDo: [:r :v | collec_OrderedCollection new. collec addAll:v . collec add:(TextEmphasis new emphasisCode:5). val _ (Array with:collec).]. temp2_RunArray runs: temp runs values: val. tableau_tableau copyReplaceFrom: (k first) to: (k last) with: temp2. ]. tableau runsAndValuesDo:[:r :v| v do:[:textCode| ((textCode class)=TextEmphasis) ifTrue: [(textCode emphasisCode=5)ifTrue:[monHtml command:( 'a href=',(self urlFromPosition: compteur)) ]. (textCode emphasisCode=1)ifTrue:[monHtml command: 'b' ]. (textCode emphasisCode=2)ifTrue:[monHtml command: 'i'.]. (textCode emphasisCode=4)ifTrue:[monHtml command: 'u'.] ] ifFalse: [monHtml command: 'font size=',textCode fontNumber printString. ] ]. r timesRepeat:[ monHtml nextPut:(self contents at: compteur). compteur_compteur+1.]. v do:[:textCode| ((textCode class)=TextEmphasis) ifTrue: [(textCode emphasisCode=4)ifTrue:[monHtml command: '/u'.]. (textCode emphasisCode=2)ifTrue:[monHtml command: '/i'.]. (textCode emphasisCode=1)ifTrue:[monHtml command: '/b' ]. (textCode emphasisCode=5)ifTrue:[monHtml command: '/a' ]. ] ifFalse: [monHtml command: 'font size=',textCode fontNumber printString. ]. ]. ].! ! !CelluleTextMorph methodsFor: 'printing' stamp: 'vince 7/12/2001 08:50'! ecrireCellule: monHtml "Žcrit le code Html relatif ˆ la cellule texte dans le FichierHtml" | cr coltexte | coltexte_(self color pixelValueForDepth: 32) radix: 16. coltexte _coltexte copyFrom:6 to: coltexte size. coltexte padded: #left to: coltexte size+1 with:$#. cr_ String with: Character cr. monHtml command:'p align=',self alignementHtml. (self color ~=owner couleurTexte) ifTrue:[ monHtml command:'FONT color= ',coltexte,' face="',self textStyle fontArray first name asString,'"'. ] ifFalse:[monHtml command:'FONT face="',self textStyle fontArray first name asString,'"'.]. self balisageTexte: monHtml. monHtml command:'/FONT'. monHtml command:'/p'; verbatim: cr.! ! !CelluleTextMorph methodsFor: 'printing' stamp: 'vince 7/17/2001 11:05'! urlFromPosition: unePosition "renvoie le lien s'il concerne la lettre situŽ ˆ la position en question dans le texte." self liens keysAndValuesDo:[:k :v|(k first=unePosition)ifTrue:[^liens at: k] ].! ! !CelluleTextMorph methodsFor: 'geometry' stamp: 'vince 7/23/2001 13:54'! position: aPoint | lePoint | lePoint_aPoint copy. (owner class = CellulePageMorph) ifTrue:[ (owner gridAuto) ifTrue: [ lePoint setX:(lePoint x -self owner left// owner gridX * owner gridX + self owner left) setY:(lePoint y -self owner top // owner gridY * owner gridY+ self owner top).]. ]. super position: lePoint.! ! BorderedMorph subclass: #CelluleVideMorph instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'nightMareWeaverVersion1'! !CelluleVideMorph commentStamp: '' prior: 0! utile lors de la crŽation de la page pour remplir les espaces vides sur la page.! !CelluleVideMorph methodsFor: 'printing' stamp: 'vince 7/12/2001 04:38'! ecrireCellule: monHtml "Žcrit le code HTML d'une cellule vide dans le FichierHTML" monHtml verbatim:' '.! ! !CelluleVideMorph methodsFor: 'initialization' stamp: 'vince 7/12/2001 03:59'! initialize super initialize. self color: Color transparent. self borderWidth: 1. self borderColor: Color black.! ! "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "! CelluleVideMorph class instanceVariableNames: ''! !CelluleVideMorph class methodsFor: 'instance creation' stamp: 'vince 7/17/2001 11:07'! de: point1 a: point2 "crŽe une cellule vide ˆ partir d'une diagonale." | cel | cel_self new initialize. cel bounds: (point1 corner: point2). ^cel! ! HtmlFileStream subclass: #FichierHtml instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'nightMareWeaverVersion1'! !FichierHtml commentStamp: '' prior: 0! sous-classe permettant la gestion de tous les caractres spŽciaux, accentuŽs...! !FichierHtml methodsFor: 'as yet unclassified' stamp: 'vince 7/12/2001 05:13'! nextPut: char "Žcrit un caractre dans le fichier en assurant une conversion" char = $< ifTrue: [^ self verbatim: '<']. char = $> ifTrue: [^ self verbatim: '>']. char = $& ifTrue: [^ self verbatim: '&']. char asciiValue=142 ifTrue: [^ self verbatim: 'é']. char asciiValue=143 ifTrue: [^ self verbatim: 'è']. char asciiValue=136 ifTrue: [^ self verbatim: 'à']. char asciiValue=157 ifTrue: [^ self verbatim: 'ù']. char asciiValue=141 ifTrue: [^ self verbatim: 'ç']. char asciiValue=137 ifTrue: [^ self verbatim: 'â']. char asciiValue=144 ifTrue: [^ self verbatim: 'ê']. char asciiValue=158 ifTrue: [^ self verbatim: 'û']. char asciiValue=148 ifTrue: [^ self verbatim: 'î']. char asciiValue=138 ifTrue: [^ self verbatim: 'ä']. char asciiValue=145 ifTrue: [^ self verbatim: 'ë']. char asciiValue=159 ifTrue: [^ self verbatim: 'ü']. char asciiValue=149 ifTrue: [^ self verbatim: 'ï']. char asciiValue=154 ifTrue: [^ self verbatim: 'ö']. char asciiValue=13 ifTrue: [self command: 'br']."return" char = $ ifTrue: [self verbatim: TabThing. ^super nextPut: char]."tab" ^ super nextPut: char! ! FileList2 subclass: #ImageFileList instanceVariableNames: '' classVariableNames: 'ImageCourante ' poolDictionaries: '' category: 'nightMareWeaverVersion1'! !ImageFileList commentStamp: '' prior: 0! File list modifiŽ pour avoir un aperu de l'image que l'on veut inserer dans le document. Une celluleImageMorph est alors crŽŽe. ImageFilelist openCelluleImageFileList. ! !ImageFileList methodsFor: 'actions' stamp: 'vince 7/17/2001 11:06'! apercu "pour avoir l'aperu de l'image selectionnŽe" self class imageCourante: self fullName. ! ! !ImageFileList methodsFor: 'actions' stamp: 'vince 7/17/2001 11:07'! creerCellule "on fabrique la celluleImageMorph ˆ partir du fichier sŽlectionnŽ" | myStream cel file1 | cel_ CelluleImageMorph new initialize. (FileDirectory default fileOrDirectoryExists: fileName)ifFalse: [ file1 _ (directory readOnlyFileNamed: fileName). FileDirectory default putFile: file1 named: fileName. file1 close. ]. myStream _ FileStream readOnlyFileNamed: fileName. cel image: (Form fromBinaryStream: myStream). myStream close. cel source: fileName. World activeHand attachMorph:cel. ! ! "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "! ImageFileList class instanceVariableNames: ''! !ImageFileList class methodsFor: 'class initialization' stamp: 'vince 7/11/2001 17:53'! imageCourante ^ImageCourante.! ! !ImageFileList class methodsFor: 'class initialization' stamp: 'vince 7/11/2001 17:54'! imageCourante: unFichierOuNil (unFichierOuNil~=nil)ifTrue:[ ImageCourante image: (Form fromFileNamed: unFichierOuNil).] ! ! !ImageFileList class methodsFor: 'class initialization' stamp: 'vince 7/17/2001 11:18'! imageCouranteInitialize "initialize la zone d'aperu" | form | (ImageCourante_InterpolatingImageMorph new ). form_Form extent: ImageCourante extent depth: 16. form fillColor: Color white. ^ImageCourante image: form.! ! !ImageFileList class methodsFor: 'class initialization' stamp: 'vince 7/17/2001 11:08'! openCelluleImageFileList "ouvre un ImageFileList" | dir aFileList window midLine fixedSize midColumn | dir _ FileDirectory default. aFileList _ self new directory: dir. aFileList optionalButtonSpecs: self specsForCelluleImageFileList. aFileList fileSelectionBlock: [ :entry :myPattern | entry isDirectory ifTrue: [ false ] ifFalse: [ #( 'gif' 'jpg' 'png') includes: (aFileList getSuffix: entry name asLowercase) ] ] fixTemps. window _ (SystemWindow labelled: dir pathName) model: aFileList. fixedSize _ 25. midLine _ 0.4. midColumn _ 0.5. self addFullPanesTo: window from: { {aFileList optionalButtonRow. 0@0 corner: 1@0. 0@0 corner: 0@fixedSize}. {aFileList morphicDirectoryTreePane. 0@0 corner: midLine@1. 0@fixedSize corner: 0@0}. {aFileList morphicFileListPane. midLine @ 0 corner: 1@(midColumn). 0@fixedSize corner: 0@0}. {self imageCouranteInitialize. midLine@midColumn corner: 1@1. 0@0 corner: 0@0}. }. aFileList postOpen. window openInWorld. ! ! !ImageFileList class methodsFor: 'class initialization' stamp: 'vince 7/16/2001 15:40'! specsForCelluleImageFileList ^ #( ('Nom' sortByName sortingByName 'trie par nom') ('Date' sortByDate sortingByDate 'trie par date') ('Taille' sortBySize sortingBySize 'trie par taille') ('Aperu' apercu none 'aperu de l''image ') ('OK' creerCellule none 'ajouter l''image') ) ! ! BookMorph subclass: #SiteMorph instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'nightMareWeaverVersion1'! !SiteMorph methodsFor: 'initialization' stamp: 'vince 7/18/2001 14:25'! initialize | aPage | super initialize. aPage_CellulePageMorph new initialize. "self insertPage: aPage pageSize: aPage extent atIndex: 1." currentPage color: Color lightMagenta. currentPage addMorph:aPage. self resizePagesTo: aPage extent. self setNewPagePrototype. ! ! !SiteMorph methodsFor: 'drawing' stamp: 'vince 7/18/2001 14:14'! openInWorld super openInWorld. self goFullScreen.! ! !SiteMorph methodsFor: 'dropping/grabbing' stamp: 'vince 7/18/2001 13:48'! wantsDroppedMorph: aMorph event: evt ^false ! !