Re: [Pharo-users] Magritte extension
Hi asbath can you attach your code? So that we can load it in a magritified image? Stef On Fri, 17 Mar 2017 07:54:37 +0100, Asbath Sama biyalou via Pharo-users <pharo-users@lists.pharo.org> wrote:
Hello.
I am using Magritte to generate reports for a pharo class. I want to customize generated components in order to have a better design.
My class is Match
Object subclass: #Match instanceVariableNames: 'date_match hour_match status actions stadium comments teams goals1 goals2 competition' classVariableNames: '' category: MyProject-Entity'
Descriptions for some variables.
Stadium is also a Class.
Match>>descriptionStadium <magritteDescription> ^ MASingleOptionDescription new label: 'Stadium'; priority: 305; accessor: #stadium; options: Team allStadiumsName; componentClass: TBSMagritteSelectListComponent; beRequired; yourself
Match>>descriptionTeams <magritteDescription> ^ MAMultipleOptionDescription new label: 'Teams'; priority: 805; accessor: #teams; options: Team allTeamsName; componentClass: MAMultiselectListComponent; yourself
The generated component in the form is not very pretty. I want to have multiple checkbox.
Match>>descriptionStatus <magritteDescription> ^ MASingleOptionDescription new label: 'Status'; priority: 505; accessor: #status; options: #('Pas en cours' 'En Cours' 'Mi-temps' 'Terminé'); componentClass: TBSMagritteSelectListComponent; yourself
For the report I use the class SEMatchReport
TBSMagritteReport subclass: #SEMatchReport instanceVariableNames: 'report' classVariableNames: '' category: 'MyProject-Components'
SEMatchReport class>>from | report matchs commandColumn | matchs := Match selectAll. report:= self rows: matchs description: (self filteredDescriptionsFrom: matchs anyOne). commandColumn := MACommandColumn new. (SEMatchReport new session isSimpleAdmin) ifTrue: [ report addColumn: (commandColumn addCommandOn: report selector: #editMatch: text: 'Modifier'; yourself; addCommandOn: report selector: #addAction: text: 'Ajouter une action'; yourself ) ] ifFalse: [ report addColumn: (commandColumn addCommandOn: report selector: #editMatch: text: 'Modifier'; yourself; addCommandOn: report selector: #deleteMatch: text: 'Supprimer'; yourself; addCommandOn: report selector: #addAction: text: 'Ajouter une action'; yourself ) ]. ^ report
I want to put some bootstrapp icons near commandColumn actions. like pencil or delete on 'Supprimer'.
SEMatchReport class>>filteredDescriptionsFrom: aMatch ^ aMatch magritteDescription select: [ :each | #(date_match hour_match stadium goals1 goals2 teams) includes: each accessor selector ]
I notice that on the generated report on column stadium we have aStadium. We don't have the value (the name). I don't know how to mention it in the filtered descriptions.
Change the color of lines in the report, etc. All that things.
Sorry for the bad english.
Thanks.
Asbath
-- Using Opera's mail client: http://www.opera.com/mail/
participants (1)
-
stepharong