-
Notifications
You must be signed in to change notification settings - Fork 7
/
MetaInfoCanvas.rbbas
executable file
·867 lines (720 loc) · 28.1 KB
/
MetaInfoCanvas.rbbas
1
#tag ClassProtected Class MetaInfoCanvasInherits Canvas #tag Event Sub MouseMove(X As Integer, Y As Integer) 'If x > btnLeft And Y > btnTop And _ 'x < btnRight And y < btnTop + 32 Then 'UpdateRatingPressed = True 'Me.RefreshRect btnLeft, btnTop, btnRight, btnTop + 32 'ElseIf UpdateRatingPressed = True Then 'UpdateRatingPressed = False 'Me.RefreshRect btnLeft, btnTop, btnRight, btnTop + 32 'End If End Sub #tag EndEvent #tag Event Sub Paint(g As Graphics) g.ForeColor = &cFFFFFF g.FillRect 0, 0, me.Width, me.Height If wndMain.ppMain.Value = 0 then If NOT App.DebugMode then If MovieAttr.ART_Fanart <> Nil Then DrawFanart MovieAttr.ART_Fanart Else DrawFanart IMGmovies If MovieAttr.ART_Poster <> Nil Then DrawPoster MovieAttr.ART_Poster End If If MovieAttr.ART_Studio <> Nil Then DrawStudioLogo MovieAttr.ART_Studio 'If MovieAttr.ART_Logo <> Nil Or MovieAttr.ART_ClearArt <> Nil Then 'If MovieAttr.ART_MPAARating <> Nil Then DrawMPAARating MovieAttr.ART_MPAARating, ( MovieAttr.ART_Banner <> Nil And Me.Width > ( 519 + 400 + 60 ) ) 'Else 'If MovieAttr.ART_MPAARating <> Nil Then DrawMPAARating MovieAttr.ART_MPAARating, ( MovieAttr.ART_Banner <> Nil ) 'End If If MovieAttr.ART_MPAARating <> Nil Then DrawMPAARating MovieAttr.ART_MPAARating, False DrawClearLogo MovieAttr.ART_Logo, MovieAttr.ART_ClearArt 'If wndMain.lstMovies.ListIndex > -1 then WriteTitle wndMain.lstMovies.Cell( wndMain.lstMovies.ListIndex, 0 ), MovieAttr.ART_Poster <> Nil If MovieAttr.Title <> "" Then If MovieAttr.DateYear > -1 Then WriteTitle MovieAttr.Title, Str( MovieAttr.DateYear ), MovieAttr.ART_Poster <> Nil Else WriteTitle MovieAttr.Title, "", MovieAttr.ART_Poster <> Nil End If Else WriteTitle wndMain.lstMovies.Cell( wndMain.lstMovies.ListIndex, 0 ), "", MovieAttr.ART_Poster <> Nil End If WriteMovieDetails MovieAttr.DescriptionTagline, MovieAttr.ART_Poster <> Nil 'WriteMovieDetails MovieAttr.ART_Poster <> Nil, MovieAttr.DescriptionTagline <> "" 'If MovieAttr.Rating > 0 then DrawRatingStars MovieAttr.Rating, MovieAttr.ART_Poster <> Nil, MovieAttr.DescriptionTagline <> "" 'WriteGeneralInfo _ 'MovieAttr.DatePremiered,_ 'MovieAttr.InfoVideoRuntime,_ 'MovieAttr.Genres,_ '"",_ 'MovieAttr.ART_Poster <> Nil,_ 'MovieAttr.DescriptionTagline <> "",_ 'MovieAttr.Rating > 0 'If MovieAttr.DescriptionPlot <> "" then WriteSummary MovieAttr.DescriptionPlot,_ 'MovieAttr.ART_Poster <> Nil,_ 'MovieAttr.DescriptionTagline <> "",_ 'MovieAttr.Rating > 0 'If MovieAttr.ART_ClearArt <> Nil Then DrawClearArt MovieAttr.ART_ClearArt 'If MovieAttr.ART_Logo <> Nil Then DrawLogo MovieAttr.ART_Logo, ( MovieAttr.ART_ClearArt <> Nil ) 'If MovieAttr.ART_Banner <> Nil Then DrawBanner MovieAttr.ART_Banner 'If MovieAttr.ART_Thumb <> Nil Then DrawThumb MovieAttr.ART_Thumb, ( MovieAttr.ART_Poster <> Nil ) 'If MovieAttr.ActorName.Ubound > -1 Then DrawActors 'DrawMovieThumbs ElseIf wndMain.ppMain.Value = 1 then ElseIf wndMain.ppMain.Value = 2 then End If // Debug // g.ForeColor = &cFF0000 // g.DrawRect 0, 0, me.Width, me.Height End Sub #tag EndEvent #tag Method, Flags = &h0 Sub DrawActors() Dim Actors as FolderItem = Preferences.fAppSupport.Child("Actors") Dim f as FolderItem Dim Pic, ActorIMG() as Picture For i as Integer = 0 to 2 Dim actorpic as String = MovieAttr.ActorName(i) + ".jpg" actorpic = actorpic.Lowercase.ReplaceAll(" ", "_" ) f = Actors.Child( actorpic ) 'If MovieAttr.ActorThumbURL(i) <> "" And f <> Nil and f.Exists Then 'ActorIMG.Append Picture.Open( f ) 'ElseIf MovieAttr.ActorThumbURL(i) <> "" Then 'ActorIMG.Append URL2Picture( MovieAttr.ActorThumbURL(i), MovieAttr.ActorName(i), "jpg", f ) 'End If If f <> Nil and f.Exists Then Pic = Picture.Open(f) If Pic <> Nil Then Pic = ScaleImage( pic, 150, 150, false, false, false ) If Pic <> Nil Then Graphics.DrawPicture Pic, 0, 0 'If ActorIMG(i) <> Nil Then Graphics.DrawPicture ActorIMG(i), Height - ActorIMG(i).Height, i * ActorIMG(i).Width Next End Sub #tag EndMethod #tag Method, Flags = &h0 Sub DrawBanner(Banner as Picture) Dim Pic as New Picture( 519, 101, 32 ) Pic.Graphics.DrawPicture( Banner, 2, 1, 515, 95, 0, 0, Banner.Width, Banner.Height ) Pic.Graphics.DrawPicture( BannerOverlay, 0, 0, Pic.Width + 1, Pic.Height + 1 ) Pic.Mask = BannerMask If ( MovieAttr.ART_Logo <> Nil Or MovieAttr.ART_ClearArt <> Nil ) And _ Me.Width > ( Pic.Width + 400 + 60 ) Then Graphics.DrawPicture Pic, 19, Me.Height - Pic.Height - 10 ElseIf MovieAttr.ART_Logo = Nil And Me.Width > ( Pic.Width + 40 ) Then Graphics.DrawPicture Pic, 19, Me.Height - Pic.Height - 10 End If End Sub #tag EndMethod #tag Method, Flags = &h0 Sub DrawCharacterArt(CharacterArt as Picture, BannerAvailable as Boolean = True, MPAARatingAvailable as Boolean = True) End Sub #tag EndMethod #tag Method, Flags = &h0 Sub DrawClearArt(ClearArt as Picture) 'Dim Pic as New Picture( ClearArt.Width * 0.68, ClearArt.Height * 0.86, 32 ) // 500x281 'Dim Pic as New Picture( ClearArt.Width * 0.80, ClearArt.Height * 0.80, 32 ) Dim Pic as New Picture( 500 * 0.80, 281 * 0.80, 32 ) Pic = ScaleImage( ClearArt, Pic.Width, Pic.Height ) Graphics.DrawPicture Pic, me.Width - Pic.Width, me.Height - Pic.Height End Sub #tag EndMethod #tag Method, Flags = &h0 Sub DrawClearLogo(Logo as Picture = Nil, ClearArt as Picture = Nil) If MovieAttr.ART_ClearArt <> Nil Then ClearArt = ScaleImage( ClearArt, 500 * 0.80, 281 * 0.80 ) Graphics.DrawPicture ClearArt, Width - ClearArt.Width - 20, Height - ClearArt.Height ElseIf MovieAttr.ART_Logo <> Nil Then Logo = ScaleImage( Logo, 400, 155 ) Graphics.DrawPicture Logo, Width - Logo.Width - 20, Height - Logo.Height - 20 End If End Sub #tag EndMethod #tag Method, Flags = &h0 Sub DrawFanart(Fanart as Picture) Dim Pic as New Picture( Width, Height, 32 ) Pic = ScaleImage( Fanart, Pic.Width, Pic.Height, True, True, False ) Pic.Graphics.DrawPicture IMGFanartOverlay, 0, 0, pic.Width, pic.Height, 0, 0, IMGFanartOverlay.Width, IMGFanartOverlay.Height Graphics.DrawPicture Pic, 0, 0 End Sub #tag EndMethod #tag Method, Flags = &h0 Sub DrawLogo(Logo as Picture, ClearArtAvailable as Boolean = True) 'Dim Pic as New Picture( Logo.Width * 0.68, Logo.Height * 0.86, 32 ) 'Pic = ScaleImage( Logo, Pic.Width, Pic.Height ) 'Dim Pic as New Picture( Logo.Width, logo.Height, 32 ) 'Pic = logo Logo = ScaleImage( Logo, 400, 155 ) Dim PosX, PosY as Integer If NOT ClearArtAvailable Then PosX = Me.Width - Logo.Width - 20 PosY = Me.Height - Logo.Height - 20 Else PosX = Me.Width - Logo.Width - 20 PosY = Me.Height - Logo.Height - 242 - 20 End If Graphics.DrawPicture Logo, PosX, PosY End Sub #tag EndMethod #tag Method, Flags = &h0 Sub DrawMovieThumbs() Dim Pic as New Picture( Width, Height, 32 ) Dim MyThumb as Picture Dim ExtraThumbs as FolderItem = MovieAttr.FolderParent.Child("extrathumbs") //Dim f() as FolderItem Dim t as Integer = 3 Dim f as FolderItem If ExtraThumbs <> Nil And extrathumbs.Exists Then If ExtraThumbs.Count <= 3 Then t = ExtraThumbs.Count - 1 For i as Integer = 0 to t // ExtraThumbs.Count f = ExtraThumbs.Item( ExtraThumbs.Count - i ) If f <> Nil and f.Exists then MyThumb = Picture.Open( ExtraThumbs.Item( ExtraThumbs.Count - i ) ) Pic = ScaleImage( MyThumb, 100, 150 / 2, False, False, True ) If Pic <> Nil Then Graphics.DrawPicture Pic, 20, Me.Height - ( ( ( 150 / 2 ) + 10 ) * i ) - 170 Graphics.ForeColor = RGB( 0, 0, 0 ) Graphics.DrawRect( 19, Me.Height - ( ( ( 150 / 2 ) + 10 ) * i ) - 169, Pic.Width + 1, Pic.Height ) End If End If Next End If 'Pic = ScaleImage( Fanart, Pic.Width, Pic.Height, True, True, False ) 'Pic.Graphics.DrawPicture IMGFanartOverlay, 0, 0, pic.Width, pic.Height, 0, 0, IMGFanartOverlay.Width, IMGFanartOverlay.Height 'Graphics.DrawPicture Pic, 0, 0 End Sub #tag EndMethod #tag Method, Flags = &h0 Sub DrawMPAARating(MPAARating as Picture, BannerAvailable as Boolean = True) //Graphics.ForeColor = RGB( 220, 220, 220 ) 'Graphics.ForeColor = RGB( 220, 220, 220 ) 'If MPAARating = Rating_G then Graphics.ForeColor = RGB( 166, 220, 166 ) 'If MPAARating = Rating_PG then Graphics.ForeColor = RGB( 220, 220, 166 ) 'If MPAARating = Rating_PG13 then Graphics.ForeColor = RGB( 220, 188, 110 ) 'If MPAARating = Rating_NC17 then Graphics.ForeColor = RGB( 220, 166, 166 ) 'If MPAARating = Rating_R then Graphics.ForeColor = RGB( 220, 110, 110 ) 'Graphics.FillRect 20, _ 'Height - MPAARating.Height - 20 - 10, _ 'MPAARating.Width + 10, _ 'MPAARating.Height + 10 'Graphics.ForeColor = RGB( 0, 0, 0 ) 'Graphics.DrawRect 20, _ 'Height - MPAARating.Height - 20 - 10, _ 'MPAARating.Width + 10, _ 'MPAARating.Height + 10 If BannerAvailable Then Graphics.DrawPicture MPAARating, 20, Height - MPAARating.Height - 101 - 20 Else Graphics.DrawPicture MPAARating, 20, Height - MPAARating.Height - 10 End If End Sub #tag EndMethod #tag Method, Flags = &h0 Sub DrawPoster(Poster as Picture) 'Dim Pic as New Picture( 154, 231, 32 ) ' 'Pic.Graphics.DrawPicture( Poster, 2, 1, 150, 225, 0, 0, Poster.Width, Poster.Height ) 'Pic.Graphics.DrawPicture( PosterOverlay, 0, 0, Pic.Width, Pic.Height ) 'Pic.Mask = PosterMask ' 'Graphics.DrawPicture Pic, 19, 15 Dim Pic as New Picture( 250, 250, 32 ) Pic.Graphics.DrawPicture( posterbg, 0, 0, 250, 250 ) Pic.Graphics.DrawPicture( Poster, 48, 16, 154, 219, 0, 0, Poster.Width, Poster.Height ) Pic.Mask = posterbg.Mask Graphics.DrawPicture Pic, -30, 2 End Sub #tag EndMethod #tag Method, Flags = &h0 Sub DrawRatingStars(Rating as Double, PosterExists as Boolean = False, OutlineExists as Boolean = False) Dim StarLeftStart as Integer = 20 Dim StarTop as Integer = 50 If PosterExists then StarLeftStart = 190 If OutlineExists then StarTop = 80 // Empty Stars For i as Integer = 1 to 10 Graphics.DrawPicture starempty, StarLeftStart, StarTop StarLeftStart = StarLeftStart + 40 Next // Text Rating Graphics.Bold = True Graphics.Italic = False Graphics.TextSize = 32 Dim strRating as String = str( Rating ) If str( Rating ).Len = 1 then strRating = str( Rating ) + ".0" Graphics.DrawString strRating, StarLeftStart + 10, StarTop + Graphics.TextSize - 3 // Full Stars If PosterExists then StarLeftStart = 190 else StarLeftStart = 20 Dim FullStars as Double = Rating For i as Integer = 1 to Rating + 1.0 FullStars = FullStars - 1 Graphics.DrawPicture starfull, StarLeftStart, StarTop, starfull.Width * FullStars + starfull.Width, starfull.Height StarLeftStart = StarLeftStart + 40 Next End Sub #tag EndMethod #tag Method, Flags = &h0 Sub DrawStudioLogo(StudioLogo as Picture) 'Graphics.ForeColor = RGB( 120, 120, 120 ) 'Graphics.FillRect( Width - Studiologo.Width - 10, 0, StudioLogo.Width, StudioLogo.Height ) Graphics.DrawPicture StudioLogo, Width - StudioLogo.Width - 10, 0 End Sub #tag EndMethod #tag Method, Flags = &h0 Sub DrawThumb(Thumb as Picture, PosterAvailable as Boolean = True) Dim Pic as New Picture( 154, 90, 32 ) Pic.Graphics.DrawPicture( Thumb, 2, 1, 150, 84, 0, 0, Thumb.Width, Thumb.Height ) Pic.Graphics.DrawPicture( ThumbOverlay, 0, 0, Pic.Width, Pic.Height ) Pic.Mask = ThumbMask If PosterAvailable Then Graphics.DrawPicture Pic, 19, 260 Else Graphics.DrawPicture Pic, 19, 20 End If End Sub #tag EndMethod #tag Method, Flags = &h0 Sub WriteMovieDetails(Tagline as String, PosterExists as Boolean = False) Dim TagLineLeft as Integer = 20 If PosterExists then TagLineLeft = 190 Graphics.Bold = False Graphics.Italic = True Graphics.TextSize = 12 Dim TagTop as Integer = 46 + Graphics.TextSize Graphics.ForeColor = &cFFFFFF Graphics.DrawString Tagline, TagLineLeft, TagTop + 1, Width - TagLineLeft - 161 - 20, False Graphics.ForeColor = &c333333 Graphics.DrawString Tagline, TagLineLeft, TagTop, Width - TagLineLeft - 161 - 20, False Graphics.Bold = False Graphics.Italic = False Graphics.TextSize = 12 If Tagline <> "" Then TagTop = TagTop + 4 + Graphics.StringHeight( Tagline, Width - TagLineLeft - 161 ) // Minutes If Val( MovieAttr.InfoVideoRuntime ) > 0 Then Dim h as Integer = Floor( Val( MovieAttr.InfoVideoRuntime ) / 60 ) Dim m as Integer = Val( MovieAttr.InfoVideoRuntime ) - ( 60 * h ) Dim Hours, Minutes as String = "" If h > 0 Then Hours = Str(h) + "h " If m > 0 Then Minutes = Str(m) + "m " Graphics.ForeColor = &cFFFFFF Graphics.DrawString Hours + Minutes + "- ", TagLineLeft, TagTop + 1, Width - TagLineLeft - 161 'Graphics.DrawString Str( MovieAttr.InfoVideoRuntime ) + " " + Loc.kMinutesShort + " - ", TagLineLeft, TagTop + 1, Width - TagLineLeft - 161 - 20, False Graphics.ForeColor = &c555555 Graphics.DrawString Hours + Minutes + "- ", TagLineLeft, TagTop, Width - TagLineLeft - 161 'Graphics.DrawString Str( MovieAttr.InfoVideoRuntime ) + " " + Loc.kMinutesShort + " - ", TagLineLeft, TagTop, Width - TagLineLeft - 161 - 20, False 'TagLineLeft = TagLineLeft + Graphics.StringWidth( Str( MovieAttr.InfoVideoRuntime ) + " " + Loc.kMinutesShort + " - " ) TagLineLeft = TagLineLeft + Graphics.StringWidth( Hours + Minutes + "- " ) End If // Genres If MovieAttr.Genres.Ubound > -1 Then For i as Integer = 0 to 2 'MovieAttr.Genres.Ubound If MovieAttr.Genres.Ubound < i Then Continue Graphics.ForeColor = &cFFFFFF If i < MovieAttr.Genres.Ubound And i < 2 Then Graphics.DrawString MovieAttr.Genres(i) + " | ", TagLineLeft, TagTop + 1 Else Graphics.DrawString MovieAttr.Genres(i), TagLineLeft, TagTop + 1 End If Graphics.ForeColor = &c555555 If i < MovieAttr.Genres.Ubound And i < 2 Then Graphics.DrawString MovieAttr.Genres(i) + " | ", TagLineLeft, TagTop TagLineLeft = TagLineLeft + Graphics.StringWidth( MovieAttr.Genres(i) + " | " ) Else Graphics.DrawString MovieAttr.Genres(i), TagLineLeft, TagTop TagLineLeft = TagLineLeft + Graphics.StringWidth( MovieAttr.Genres(i) ) End If Next End If // Premiere Date If MovieAttr.DatePremiered <> "" Then Graphics.ForeColor = &cFFFFFF Graphics.DrawString " - " + PrettyDate( MovieAttr.DatePremiered, True ), TagLineLeft, TagTop + 1 Graphics.ForeColor = &c555555 Graphics.DrawString " - " + PrettyDate( MovieAttr.DatePremiered, True ), TagLineLeft, TagTop TagTop = TagTop + 18 End If TagLineLeft = 20 If PosterExists then TagLineLeft = 190 // Plot If MovieAttr.DescriptionPlot <> "" Then Graphics.ForeColor = &cFFFFFF Graphics.DrawString MovieAttr.DescriptionPlot, TagLineLeft, TagTop + 19, Width - TagLineLeft - 20, False Graphics.ForeColor = &c333333 Graphics.DrawString MovieAttr.DescriptionPlot, TagLineLeft, TagTop + 18, Width - TagLineLeft - 20, False End If End Sub #tag EndMethod #tag Method, Flags = &h0 Sub WriteTitle(Title as String, Year as String = "", PosterExists as Boolean = False) Graphics.Bold = True If Title.Len >= 56 then Graphics.TextSize = 14 Elseif Title.Len >= 36 then Graphics.TextSize = 18 Else Graphics.TextSize = 28 End If Dim TitleLeft as Integer = 20 If PosterExists then TitleLeft = 190 Dim YearLeft as Double = TitleLeft + Graphics.StringWidth( Title ) Graphics.Italic = False Graphics.ForeColor = &c000000 If Year <> "" Then Graphics.DrawString " (" + Year + ")", YearLeft, 9 + Graphics.TextSize', Width - YearLeft - 300 - 84, True Graphics.ForeColor = &cFFFFFF Graphics.DrawString Title, TitleLeft, 11 + Graphics.TextSize, Width - 300 - 84, True If Year <> "" Then Graphics.DrawString " (" + Year + ")", YearLeft, 11 + Graphics.TextSize', Width - YearLeft - 300 - 84, True Graphics.ForeColor = &c333333 Graphics.DrawString Title, TitleLeft, 10 + Graphics.TextSize, Width - 300 - 84, True Graphics.ForeColor = &c999999 If Year <> "" Then Graphics.DrawString " (" + Year + ")", YearLeft, 10 + Graphics.TextSize', Width - YearLeft - 300 - 84, True End Sub #tag EndMethod #tag Method, Flags = &h0 Sub zWriteGeneralInfo(Premiered as String, Runtime as String, Genres() as String, Status as String = "", PosterExists as Boolean = False, TagLineExists as Boolean = False, StarsExist as Boolean = False) Dim GeneralInfoTop as Integer = 50 Dim GeneralInfoLeft as Integer = 20 If PosterExists then GeneralInfoLeft = 190 If TagLineExists then GeneralInfoTop = GeneralInfoTop + 30 If StarsExist then GeneralInfoTop = GeneralInfoTop + 40 Graphics.TextSize = 12 Graphics.Italic = False GeneralInfoCount = 0 // Runtime If Runtime <> "" And Val( MovieAttr.InfoVideoRuntime ) > 0 then Graphics.Bold = True Graphics.DrawString Loc.kRuntime, GeneralInfoLeft, GeneralInfoTop + Graphics.TextSize + ( 18 * GeneralInfoCount ) Graphics.Bold = False Graphics.DrawString Val( MovieAttr.InfoVideoRuntime ).Minutes2Hours, GeneralInfoLeft + 100, GeneralInfoTop + Graphics.TextSize + ( 18 * GeneralInfoCount ) End If // Premiered If Premiered <> "" then Graphics.Bold = True GeneralInfoCount = GeneralInfoCount + 1 Graphics.DrawString Loc.kPremiered, GeneralInfoLeft, GeneralInfoTop + Graphics.TextSize + ( 18 * GeneralInfoCount ) Graphics.Bold = False Dim DateString as String = PrettyDate( Premiered ) // Dim DDate() as String = split( Premiered, "-" ) // If DDate.Ubound = 2 then // DateString = DDate(2) + " " + Int2Month( Val( DDate(1) ) ) + ", " + DDate(0) // ElseIf DDate.Ubound = 1 then // DateString = Int2Month( Val( DDate(1) ) ) + ", " + DDate(0) // ElseIf DDate.Ubound = 0 then // DateString = DDate(0) // End If Graphics.DrawString DateString, GeneralInfoLeft + 100, GeneralInfoTop + Graphics.TextSize + ( 18 * GeneralInfoCount ) End If // Genres If Genres.Ubound > -1 then Graphics.Bold = True GeneralInfoCount = GeneralInfoCount + 1 Dim strGenre as String = Loc.kGenre If genres.Ubound > 0 then strGenre = Loc.kGenres Graphics.DrawString strGenre, GeneralInfoLeft, GeneralInfoTop + Graphics.TextSize + ( 18 * GeneralInfoCount ) Graphics.Bold = False Dim strGenres as String For i as Integer = 0 to MovieAttr.Genres.Ubound If i = MovieAttr.Genres.Ubound then strGenres = strGenres + MovieAttr.Genres(i) Else strGenres = strGenres + MovieAttr.Genres(i) + ", " End If Next Graphics.DrawString strGenres, GeneralInfoLeft + 100, GeneralInfoTop + Graphics.TextSize + ( 18 * GeneralInfoCount ), Width - ( GeneralInfoLeft + 100 ) - 20, True End If // Status If Status <> "" then Graphics.Bold = True GeneralInfoCount = GeneralInfoCount + 1 Graphics.DrawString Loc.kStatus, GeneralInfoLeft, GeneralInfoTop + Graphics.TextSize + ( 18 * GeneralInfoCount ) Graphics.Bold = False Graphics.DrawString Status, GeneralInfoLeft, GeneralInfoTop + Graphics.TextSize + ( 18 * GeneralInfoCount ) End If End Sub #tag EndMethod #tag Method, Flags = &h0 Sub zWriteMovieDetails(PosterExists as Boolean = False, TaglineExists as Boolean = False) Dim TagLineLeft as Integer = 20 If PosterExists then TagLineLeft = 190 Graphics.Bold = False Graphics.Italic = False Graphics.TextSize = 12 Dim TagTop as Integer = 46 + Graphics.TextSize If TaglineExists Then TagTop = TagTop + 18 // Minutes If Val( MovieAttr.InfoVideoRuntime ) > 0 Then Graphics.ForeColor = &cFFFFFF Graphics.DrawString Str( MovieAttr.InfoVideoRuntime ) + " " + Loc.kMinutesShort + " - ", TagLineLeft, TagTop + 1, Width - TagLineLeft - 161 - 20, False Graphics.ForeColor = &c333333 Graphics.DrawString Str( MovieAttr.InfoVideoRuntime ) + " " + Loc.kMinutesShort + " - ", TagLineLeft, TagTop, Width - TagLineLeft - 161 - 20, False TagLineLeft = TagLineLeft + Graphics.StringWidth( Str( MovieAttr.InfoVideoRuntime ) + " " + Loc.kMinutesShort + " - " ) End If If MovieAttr.Genres.Ubound > -1 Then For i as Integer = 0 to 2 'MovieAttr.Genres.Ubound If MovieAttr.Genres.Ubound < i Then Continue Graphics.ForeColor = &cFFFFFF If i < MovieAttr.Genres.Ubound And i < 2 Then Graphics.DrawString MovieAttr.Genres(i) + " | ", TagLineLeft, TagTop + 1 Else Graphics.DrawString MovieAttr.Genres(i), TagLineLeft, TagTop + 1 End If Graphics.ForeColor = &c333333 If i < MovieAttr.Genres.Ubound And i < 2 Then Graphics.DrawString MovieAttr.Genres(i) + " | ", TagLineLeft, TagTop TagLineLeft = TagLineLeft + Graphics.StringWidth( MovieAttr.Genres(i) + " | " ) Else Graphics.DrawString MovieAttr.Genres(i), TagLineLeft, TagTop TagLineLeft = TagLineLeft + Graphics.StringWidth( MovieAttr.Genres(i) ) End If Next End If If MovieAttr.DatePremiered <> "" Then Graphics.ForeColor = &cFFFFFF Graphics.DrawString " - " + PrettyDate( MovieAttr.DatePremiered, True ), TagLineLeft, TagTop + 1 Graphics.ForeColor = &c333333 Graphics.DrawString " - " + PrettyDate( MovieAttr.DatePremiered, True ), TagLineLeft, TagTop End If End Sub #tag EndMethod #tag Method, Flags = &h0 Sub zWriteSummary(Summary as String, PosterExists as Boolean = False, TagLineExists as Boolean = False, StarsExist as Boolean = False) Dim GeneralInfoTop as Integer = 50 Dim GeneralInfoLeft as Integer = 20 If PosterExists then GeneralInfoLeft = 190 If TagLineExists then GeneralInfoTop = GeneralInfoTop + 30 If StarsExist then GeneralInfoTop = GeneralInfoTop + 40 GeneralInfoCount = GeneralInfoCount + 2 Graphics.Bold = True Graphics.DrawString Loc.kPlot, GeneralInfoLeft, GeneralInfoTop + Graphics.TextSize + ( 18 * GeneralInfoCount ) GeneralInfoCount = GeneralInfoCount + 1 Graphics.Bold = False Graphics.DrawString Summary, GeneralInfoLeft, GeneralInfoTop + Graphics.TextSize + ( 18 * GeneralInfoCount ), Width - GeneralInfoLeft - 20, False End Sub #tag EndMethod #tag Property, Flags = &h0 btnLeft As Integer #tag EndProperty #tag Property, Flags = &h0 btnRight As Integer #tag EndProperty #tag Property, Flags = &h0 btnTop As Integer #tag EndProperty #tag Property, Flags = &h0 GeneralInfoCount As Integer = 0 #tag EndProperty #tag Property, Flags = &h0 UpdateRatingPressed As Boolean = False #tag EndProperty #tag ViewBehavior #tag ViewProperty Name="AcceptFocus" Visible=true Group="Behavior" Type="Boolean" InheritedFrom="Canvas" #tag EndViewProperty #tag ViewProperty Name="AcceptTabs" Visible=true Group="Behavior" Type="Boolean" InheritedFrom="Canvas" #tag EndViewProperty #tag ViewProperty Name="AutoDeactivate" Visible=true Group="Appearance" InitialValue="True" Type="Boolean" InheritedFrom="Canvas" #tag EndViewProperty #tag ViewProperty Name="Backdrop" Visible=true Group="Appearance" Type="Picture" EditorType="Picture" InheritedFrom="Canvas" #tag EndViewProperty #tag ViewProperty Name="btnLeft" Group="Behavior" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="btnRight" Group="Behavior" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="btnTop" Group="Behavior" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="DoubleBuffer" Visible=true Group="Behavior" InitialValue="False" Type="Boolean" InheritedFrom="Canvas" #tag EndViewProperty #tag ViewProperty Name="Enabled" Visible=true Group="Appearance" InitialValue="True" Type="Boolean" InheritedFrom="Canvas" #tag EndViewProperty #tag ViewProperty Name="EraseBackground" Visible=true Group="Behavior" InitialValue="True" Type="Boolean" InheritedFrom="Canvas" #tag EndViewProperty #tag ViewProperty Name="GeneralInfoCount" Group="Behavior" InitialValue="0" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Height" Visible=true Group="Position" InitialValue="100" Type="Integer" InheritedFrom="Canvas" #tag EndViewProperty #tag ViewProperty Name="HelpTag" Visible=true Group="Appearance" Type="String" EditorType="MultiLineEditor" InheritedFrom="Canvas" #tag EndViewProperty #tag ViewProperty Name="Index" Visible=true Group="ID" Type="Integer" InheritedFrom="Canvas" #tag EndViewProperty #tag ViewProperty Name="InitialParent" InheritedFrom="Canvas" #tag EndViewProperty #tag ViewProperty Name="Left" Visible=true Group="Position" Type="Integer" InheritedFrom="Canvas" #tag EndViewProperty #tag ViewProperty Name="LockBottom" Visible=true Group="Position" Type="Boolean" InheritedFrom="Canvas" #tag EndViewProperty #tag ViewProperty Name="LockLeft" Visible=true Group="Position" Type="Boolean" InheritedFrom="Canvas" #tag EndViewProperty #tag ViewProperty Name="LockRight" Visible=true Group="Position" Type="Boolean" InheritedFrom="Canvas" #tag EndViewProperty #tag ViewProperty Name="LockTop" Visible=true Group="Position" Type="Boolean" InheritedFrom="Canvas" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" Type="String" InheritedFrom="Canvas" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" InheritedFrom="Canvas" #tag EndViewProperty #tag ViewProperty Name="TabIndex" Visible=true Group="Position" InitialValue="0" Type="Integer" InheritedFrom="Canvas" #tag EndViewProperty #tag ViewProperty Name="TabPanelIndex" Group="Position" InitialValue="0" Type="Integer" InheritedFrom="Canvas" #tag EndViewProperty #tag ViewProperty Name="TabStop" Visible=true Group="Position" InitialValue="True" Type="Boolean" InheritedFrom="Canvas" #tag EndViewProperty #tag ViewProperty Name="Top" Visible=true Group="Position" Type="Integer" InheritedFrom="Canvas" #tag EndViewProperty #tag ViewProperty Name="UpdateRatingPressed" Group="Behavior" InitialValue="False" Type="Boolean" #tag EndViewProperty #tag ViewProperty Name="UseFocusRing" Visible=true Group="Appearance" InitialValue="True" Type="Boolean" InheritedFrom="Canvas" #tag EndViewProperty #tag ViewProperty Name="Visible" Visible=true Group="Appearance" InitialValue="True" Type="Boolean" InheritedFrom="Canvas" #tag EndViewProperty #tag ViewProperty Name="Width" Visible=true Group="Position" InitialValue="100" Type="Integer" InheritedFrom="Canvas" #tag EndViewProperty #tag EndViewBehaviorEnd Class#tag EndClass