manticore/iconize.pl
2023-12-22 15:37:48 +01:00

55 lines
2.4 KiB
Perl
Executable File

#!/usr/bin/env perl
use strict;
use warnings;
use Tk;
use POSIX;
setlocale(LC_NUMERIC, "C");
BEGIN {
unshift @INC, '.';
};
use Manticore::Mantis;
my $main = MainWindow->new();
my $can = $main->Canvas(-width=>1000,-height=>900,-background=>'#aaaaaa')->pack();
Manticore::Mantis::fontLoader(dir=>"fonts/refont");
show();
MainLoop;
sub show {
my $x = 0;
my $y = 0;
my $distx = 230;
my $disty = 39;
for(qw(IconNew IconOK IconNotOK IconWarning IconProblem IconVisible IconInvisible IconCourseFavouriteManual IconCourseFavouriteAutomatic IconCourseFavouriteOff IconEnrolTrue IconEnrolFalse IconPlanned IconAnnounce IconExam IconExamRegisterTrue IconExamRegisterFalse IconExamAutoOccurrenceNudgeUp IconExamAutoOccurrenceNudgeDown IconExamAutoOccurrenceIgnore IconExamAutoOccurrenceReconsider IconCommentTrue IconCommentFalse IconLink IconFileDownload IconFileUpload IconFileZip IconFileCSV IconSFTQuestion IconSFTHint IconSFTSolution IconSFTMarking IconEmail IconRegisterTemplate IconNoCorrectors IconRemoveUser IconTooltipDefault IconNotificationSuccess IconNotificationInfo IconNotificationWarning IconNotificationError IconNotificationNonactive IconFavourite IconLanguage IconNavContainerClose IconPageActionChildrenClose IconMenuNews IconMenuHelp IconMenuProfile IconMenuLogin IconMenuLogout IconBreadcrumbsHome IconMenuExtra IconMenuCourseList IconMenuCorrections IconMenuExams IconMenuAdmin IconMenuLms IconMenuQualification IconPageActionPrimaryExpand IconPageActionSecondary IconBreadcrumbSeparator IconFileUploadSession IconStandaloneFieldError IconFileUser IconNotification IconNotificationSent IconNoNotification IconPersonalIdentification IconMenuWorkflows IconVideo IconSubmissionUserDuplicate IconSubmissionNoUsers IconReset IconBlocked IconCertificate IconPrintCenter IconLetter IconAt IconSupervisor IconSupervisorForeign IconExpired IconLocked IconUnlocked IconResetTries IconCompany IconEdit IconUserEdit)) {
$can->createText(45+$x*$distx,12+$y*$disty,-text=>$_,-anchor=>'w');
my $icon = Manticore::Mantis::glyphemDisplay($_);
if($icon) {
for my $ic(@$icon) {
my @newpoly = ();
my $xy = 1;
for(@$ic) {
push @newpoly, ($xy
? ($_*6+0+$x*$distx)
: ($_*6-12+$y*$disty)
);
$xy = $xy ? 0 : 1;
}
$can->createPolygon(@newpoly, -fill=>'#000000', -outline=>undef);
}
}
$y++;
if($y > 22) {
$y = 0;
$x++;
}
}
}