Skip to content

Commit

Permalink
Added reorder algorithm and fixed bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Dadido3 committed Jul 19, 2017
1 parent 9173a95 commit 7ef9f8b
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 11 deletions.
27 changes: 24 additions & 3 deletions Includes/Templates.pbi
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ DeclareModule Templates
#Reorder_Right_To_Left
#Reorder_Top_To_Bottom
#Reorder_Bottom_To_Top

#Reorder_Replace_White_First
#Reorder_Replace_White_Last
EndEnumeration

Enumeration
Expand Down Expand Up @@ -558,6 +561,8 @@ Module Templates
AddGadgetItem(Window\ComboBox_Reorder [i], #Reorder_Right_To_Left, "Right to left")
AddGadgetItem(Window\ComboBox_Reorder [i], #Reorder_Top_To_Bottom, "Top to bottom")
AddGadgetItem(Window\ComboBox_Reorder [i], #Reorder_Bottom_To_Top, "Bottom to top")
AddGadgetItem(Window\ComboBox_Reorder [i], #Reorder_Replace_White_First, "Replace white first")
AddGadgetItem(Window\ComboBox_Reorder [i], #Reorder_Replace_White_Last, "Replace white last")
Next

Y + 10
Expand Down Expand Up @@ -749,6 +754,20 @@ Module Templates
ProcedureReturn #True
EndProcedure

Procedure Reorder_White(*Object.Object, Options=#PB_Sort_Ascending)
ForEach *Object\Difference()
If *Object\Difference()\Canvas_Color_Index = 0
*Object\Difference()\Reorder_Temp = 0
Else
*Object\Difference()\Reorder_Temp = 1
EndIf
Next

SortStructuredList(*Object\Difference(), Options, OffsetOf(Difference\Reorder_Temp), TypeOf(Difference\Reorder_Temp))

ProcedureReturn #True
EndProcedure

Procedure Draw(*Object.Object)
Protected i
Protected Counter
Expand All @@ -773,6 +792,8 @@ Module Templates
Case #Reorder_Right_To_Left : Reorder_X(*Object, #PB_Sort_Descending)
Case #Reorder_Top_To_Bottom : Reorder_Y(*Object, #PB_Sort_Ascending)
Case #Reorder_Bottom_To_Top : Reorder_Y(*Object, #PB_Sort_Descending)
Case #Reorder_Replace_White_First : Reorder_White(*Object, #PB_Sort_Ascending)
Case #Reorder_Replace_White_Last : Reorder_White(*Object, #PB_Sort_Descending)
EndSelect
Next

Expand Down Expand Up @@ -1030,9 +1051,9 @@ Module Templates

EndModule

; IDE Options = PureBasic 5.60 beta 6 (Windows - x64)
; CursorPosition = 998
; FirstLine = 960
; IDE Options = PureBasic 5.60 (Windows - x64)
; CursorPosition = 758
; FirstLine = 756
; Folding = ------
; EnableXP
; Executable = ..\Pixelcanvas Client.exe
Expand Down
10 changes: 7 additions & 3 deletions Pixelcanvas Client.pb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ DeclareModule Main
; ################################################### Prototypes ##################################################

; ################################################### Constants ###################################################
#Version = 0954
#Version = 0955

#Software_Name = "Pixelcanvas.io Custom Client"

Expand Down Expand Up @@ -417,7 +417,10 @@ Module Main
Settings\Captcha_Requester = GetToolBarButtonState(Window\ToolBar, #Menu_Captcha_Requester)

Case #Menu_Settings_Change_Fingerprint
Settings\Fingerprint = InputRequester("Change fingerprint", "Enter the new fingerprint", Settings\Fingerprint)
Protected Result.s = InputRequester("Change fingerprint", "Enter the new fingerprint", Settings\Fingerprint)
If Result
Settings\Fingerprint = Result
EndIf

Case #Menu_About
About::Open()
Expand Down Expand Up @@ -1524,7 +1527,8 @@ Module Main

EndModule
; IDE Options = PureBasic 5.60 beta 6 (Windows - x64)
; CursorPosition = 22
; CursorPosition = 419
; FirstLine = 394
; Folding = -----
; EnableThread
; EnableXP
Expand Down
10 changes: 5 additions & 5 deletions Pixelcanvas.io Custom Client.pbp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<section name="data">
<explorer view="" pattern="0"/>
<log show="1"/>
<lastopen date="2017-07-19 00:05" user="David Vogel" host="DAVIDS"/>
<lastopen date="2017-07-19 19:24" user="David Vogel" host="DAVIDS"/>
</section>
<section name="files">
<file name="Includes\About.pbi">
Expand All @@ -28,15 +28,15 @@
</file>
<file name="Includes\Templates.pbi">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" panelstate="++"/>
<fingerprint md5="a2dac144cf1747e9efb7fafbdb6cf5bb"/>
<fingerprint md5="fcc411e578a562a3f60a172f2c91c163"/>
</file>
<file name="Includes\Websocket_Client.pbi">
<config load="0" scan="1" panel="1" warn="1" lastopen="0" panelstate="++"/>
<fingerprint md5="b332f6c29fbd1f51864c2bdea06cb3f9"/>
</file>
<file name="Pixelcanvas Client.pb">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" panelstate="+"/>
<fingerprint md5="d43bd0033e0375bd5d89b8eff6afed6b"/>
<fingerprint md5="fcfb3a9c787171dc7e8d40e9a4de9e4e"/>
</file>
</section>
<section name="targets">
Expand All @@ -47,8 +47,8 @@
<executable value="Distribution\Windows x86\Pixelcanvas Client.exe"/>
<directory value="Distribution\Windows x86\"/>
<options xpskin="1" onerror="1" debug="1"/>
<compilecount enable="1" value="545"/>
<buildcount enable="1" value="82"/>
<compilecount enable="1" value="550"/>
<buildcount enable="1" value="86"/>
</target>
</section>
</project>

0 comments on commit 7ef9f8b

Please sign in to comment.