Search found 50 matches

by Sirius-2337
Thu Jul 17, 2025 6:07 pm
Forum: Coding Questions
Topic: ExplorerTreeGadget() and GetGadgetItemText()
Replies: 18
Views: 1272

Re: ExplorerTreeGadget() and GetGadgetItemText() >> is this a bug?


In my documentation ExplorerTreeGadget() is explained:
GetGadgetState() : Lets you know if the selected item is a directory or a file. <<


That is correct, but you are using the return value as 'position' for GetGadgetItemText.
It's not returning an index, just the type of the selected item.
by Sirius-2337
Sat Sep 07, 2024 3:26 am
Forum: Coding Questions
Topic: Webview callback with umlaut
Replies: 2
Views: 464

Re: Webview callback with umlaut


Hm ...

small letters are working:
Protected string$ = ~"{ \"text\": \"äöü^âá\"}"


Oh, you're right didn't notice that.
Some more characters that do not work:
~"{ \"text\": \"Þ\"}"
~"{ \"text\": \"Ø\"}"
~"{ \"text\": \"×\"}"
by Sirius-2337
Fri Sep 06, 2024 4:15 pm
Forum: Coding Questions
Topic: Webview callback with umlaut
Replies: 2
Views: 464

Webview callback with umlaut

Hi,
BindWebviewCallback does not not work when the returned string contains umlauts.
But no error messages in PB or WebView console.
Example Code:
Procedure ComputeJS(JsonParameters$)
; Protected string$ = ~"{ \"text\": \"ABC\"}"
Protected string$ = ~"{ \"text\": \"äöüÄÖÜß^âá\"}"
; Protected ...
by Sirius-2337
Mon Sep 02, 2019 2:31 pm
Forum: Windows
Topic: [Solved] OptionGadgets and ampersand
Replies: 7
Views: 3880

Re: OptionGadgets and ampersand

If OpenWindow(0, 300, 200, 140, 110, "OptionGadgets", #PB_Window_SystemMenu)
OptionGadget(0, 30, 20, 100, 20, "Option 1&&")
OptionGadget(1, 30, 45, 100, 20, "Option 2&&&&")
OptionGadget(2, 30, 70, 100, 20, "Option 3&&&&&&")
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
by Sirius-2337
Wed Aug 21, 2019 3:24 pm
Forum: Coding Questions
Topic: Question about (x)include files
Replies: 8
Views: 1963

Re: Question about (x)include files


#MY_USERNAME = "user01"

XIncludeFile "C:\Users\" + #MY_USERNAME + "\Documents\MY_PROJECT\_includes\MY_INCLUDE.pbi"

;OR

XIncludeFile "\_includes\MY_INCLUDE.pbi"

;OR

#PC = 2

CompilerIf #PC = 1
XIncludeFile "C:\Users\MY_USERNAME\Documents\MY_PROJECT\_includes\MY_INCLUDE.pbi"
CompilerElseIf #PC ...
by Sirius-2337
Wed Aug 21, 2019 6:41 am
Forum: Coding Questions
Topic: Animation [quality]
Replies: 19
Views: 5065

Re: Animation [quality]

Of course
Well... this is the best result I've ever get, thank you very mach 8)
There is some not covered moments like if you click fast for example


This code fixes the problem with fast clicking.

edit: Fixed it even more :)

EnableExplicit

Enumeration EnumImage
#Image_FlyOut
EndEnumeration ...
by Sirius-2337
Tue Aug 20, 2019 3:50 pm
Forum: Coding Questions
Topic: Animation [quality]
Replies: 19
Views: 5065

Re: Animation [quality]

Everything wrote:
Sirius-2337 wrote:How about this?
Damn close!
Could you do that with ~ half window wide (like in code from Bisonte)?
Of course. I edited the code above.
by Sirius-2337
Tue Aug 20, 2019 3:11 pm
Forum: Coding Questions
Topic: Animation [quality]
Replies: 19
Views: 5065

Re: Animation [quality]

You mean something like this ? It moves slow and I guess look nice because of it but
I want my animation looks exactly the same as in the gif image (same speed & same easing) and here you might get some problems...

How about this?

EnableExplicit

Enumeration EnumImage 1
#Image_FlyOut ...
by Sirius-2337
Sat Aug 03, 2019 5:10 pm
Forum: Coding Questions
Topic: Speed Up Listicon Loading?
Replies: 8
Views: 2429

Re: Speed Up Listicon Loading?

Instead of SendMessage_(GadgetID(0),#WM_SETREDRAW,0,0) you can use HideGadget(0, 1)

NoRedraw=1

OpenWindow(0,320,256,640,480,"ListIcon",#PB_Window_SystemMenu)
ListIconGadget(0,20,20,600,450,"Items",600)

If NoRedraw=1
HideGadget(0, 1)
EndIf

start.q=ElapsedMilliseconds()
For i=1 To 100000 ...
by Sirius-2337
Fri Aug 02, 2019 6:25 pm
Forum: Coding Questions
Topic: (Solved) SortStructuredList with nested List
Replies: 5
Views: 1686

Re: SortStructuredList with nested List

Sorting the list while 'foreaching' is not a good idea.

Code: Select all

  SortStructuredList(a(), #PB_Sort_Ascending, OffsetOf(SA\name$), TypeOf(SA\name$))  
  ForEach a()    
      SortStructuredList(a()\b(), #PB_Sort_Ascending, OffsetOf(SB\name$), TypeOf(SB\name$))   
  Next
by Sirius-2337
Thu Aug 01, 2019 1:48 pm
Forum: Windows
Topic: record keystrokes and playback
Replies: 10
Views: 4271

Re: record keystrokes and playback

Added code from this topic .
Structure L4B
StructureUnion
l.l
b.b[4]
EndStructureUnion
EndStructure
Global key$= Space(255)
Global chk_ctrl.l,chk_shft.l,chk_alt.l
Procedure WindowCallback(hWnd, uMsg, wParam, lParam)
Select uMsg
Case #WM_CHAR
k.L4B : k\l=lParam

SetGadgetText(1, Str(lParam ...
by Sirius-2337
Wed Oct 24, 2018 5:11 pm
Forum: Coding Questions
Topic: How to get Pdfium to work (done)
Replies: 47
Views: 23736

Re: How to get Pdfium to work (done)

You can get it here https://github.com/pvginkel/PdfiumBuild
or direct download

Open with 7z and extract "Build\x64\pdfium.dll"
by Sirius-2337
Sat Sep 01, 2018 3:32 pm
Forum: Coding Questions
Topic: Read from PDF
Replies: 26
Views: 18129

Re: Read from PDF

I have been looking for something like this for a while. Unfortunately, when I try either of the examples by fabulouspaul or verleihnix InitLibrary() generates an "Invalid memory access. (write error at address 0)" error.
PB 5.70 on Win 7 Ult X64
Any thoughts or pointers would be welcome.
Best ...
by Sirius-2337
Fri Apr 13, 2018 3:13 pm
Forum: Tricks 'n' Tips
Topic: Fill your PC with sand
Replies: 26
Views: 8099

Re: Fill your PC with sand

The problem was with LineXY() not having the right color specified so that FillArea() would fill the whole screen.

LineXY(200,479,300,400)
LineXY(200,479,200,485)
LineXY(200,485,300,406)
LineXY(300,400,300,406)
FillArea(202,482,folor,folor)
LineXY(430,200,700,400)
LineXY(430,206,700,406 ...
by Sirius-2337
Sat Oct 08, 2016 4:17 pm
Forum: Coding Questions
Topic: CryptRandom puzzle
Replies: 2
Views: 2383

Re: CryptRandom puzzle

The problem is this line:
results(balancedCryptRandom(6)) + 1
It is only a shortcut and will be expanded to this line by the compiler:
results(balancedCryptRandom(6)) = results(balancedCryptRandom(6)) + 1
Now you see the problem I guess.

You need to write it like this:
a = balancedCryptRandom ...