Pimp My PureBasic :D

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
nco2k
Addict
Addict
Posts: 1344
Joined: Mon Sep 15, 2003 5:55 am

Pimp My PureBasic :D

Post by nco2k »

since fred is among the living again :D, here is an overview of in my opinion missing and needed stuff, for a even more "complete" purebasic:

Code: Select all

[WINDOW]
- WindowRealWidth(#Window) ;including border, titlebar etc.
- WindowRealHeight(#Window) ;including border, titlebar etc.
- WindowClientX(#Window) ;excluding border, titlebar etc.
- WindowClientY(#Window) ;excluding border, titlebar etc.
- WindowTitleBarHeight(#Window)
- WindowBorderWidth(#Window)
- IsWindowEnabled(#Window)
- IsWindowVisible(#Window)
- GetStatusBarText(#StatusBar, Field)
- SetWindowImage(#Window, ImageID) ;to set a background image
- #PB_Event_InactivateWindow
- #PB_Event_WindowTimeOut ;for WaitWindowEvent() based timeouts


[GADGET]
- IsGadgetEnabled(#Gadget)
- IsGadgetVisible(#Gadget)
- SetGadgetCallback(@ProcedureName() [, #Gadget])
- SetGadgetColor() support for CheckBoxGadgets


[MEMORY]
- ClearMemory(*Memory)
- FillMemory(*Memory, Value [, Len])
- PeekStringFormat(*MemoryBuffer)
- PokeStringFormat(*MemoryBuffer [, Format])
- PokeStringNullByte(File [, Format])
- BOMSize([Format])


[ARRAY]
- CountArray(Array)
- ClearArray(Array)
- ForEach Support for Arrays ;for nicer writing/reading
- IsArray(Array)
- Creating Arrays on the fly


[LINKED LIST]
- Position dependent (faster) SelectElement()
- CopyList(LinkedList1(), LinkedList2())
- IsList(List) ;for linked lists
- Creating Linked Lists on the fly
- Alias Support so we can write ;MyVar Alias MyLinkedList() : ForEach MyVar : Next


[SCREEN]
- ScreenWidth()
- ScreenHeight()
- ScreenDepth()
- ResizeScreen(x, y, Width, Height, [RightOffset, BottomOffset])
- IsScreen()
- DirectX 9 SubSystem
- OpenGL Subsystem ;some commands are missing like CreateSprite, SpriteOutput, SetFrameRate, UseBuffer...
- Tripple Buffering Support
- Multiple Joysticks & Analog Joystick Support


[SPRITE]
- DisplaySprite(#Sprite, x, y [, Width, Height]) ;optional width & height
- ResizeSprite(#Sprite, Width, Height [, Flag])
- RotateSprite(#Sprite, Angle, Mode)
- 2D Sprites (PNG) Alpha Channel Support (DirectX9) if possible, otherwise emulation
- Sprite3D to accept floats
- More Sprite3DQuality() filter methods, bikubish, hq2x...


[SOUND]
- SoundStatus(#Sound)
- SoundLength(#Sound)
- SoundSeek(#Sound)
- PauseSound(#Sound)
- ResumeSound(#Sound)
- CopySound(#Sound1, #Sound2)
- SaveSound(#Sound, Filename$ [,Format [,Flags]])
- UseOGGSoundEncoder()
- UseFLACSoundDecoder()
- UseFLACSoundEncoder()
- Sound Streaming Support


[FILE]
- ReadString(#File, [, Len [, Flag]]) ;optional length parameter
- WriteStringNullByte(File [, Format])
- Optional #PB_FileSystem_Force Flag for DeleteFile()
- #PB_FileSystem_EmptyOnly for DeleteDirectory()
- Multiple patterns for ExamineDirectory


[IMAGE]
- Faster ImageOutput()
- Alpha Channel Support
- DrawImage(ImageID, x, y, Width, Height [, Flag]) ;optional Flag #PB_Image_Smooth / #PB_Image_Raw for resizing
- UseTIFFImageEncoder()
- UseTGAImageEncoder()


[CIPHER]
- CRC32FileFingerprint(Filename$, [Length])
- CRC32Fingerprint(Buffer, [Length, Initial])
- MD5FileFingerprint(Filename$, [Length])
- MD5Fingerprint(Buffer, [Length, Initial])


[MISC]
- IsNetworkConnection(Connection)
- CatchFont(#Font, MemoryAdress [, Length [, Flags]])
- CatchMovie(#Movie, *Memory, [, Length [, Flags]])
- PackMemorySize(*Memory) ;returns the uncompressed filesize
- AbsInt(Integer)
- IsAppRunning(AppName$) ;to check if my app is already running once
- Windows Registry Support ;without the need for winapi/userlibs
- CreateShortcut(Path$, Link$, WorkingDir$, Argument$, Description$) ;to create .lnk etc. shortcuts
- #PB_All ;for Close*() & Free*() commands, if possible
- TreeLinkedList Library
- 7Zip Plugin
- DebugClear ;to clear the debugger output
- Check Syntax option in the IDE, without the need to run the App
- Optional declaration of types for Variables in Structures
- Creating own UserLibs (like TaliBite)
- MSLU Support for Win9x (unicows.dll)
- Unsigned Data Types
- Creating 64Bit Executables
c ya,
nco2k
Last edited by nco2k on Sat Aug 11, 2007 4:53 pm, edited 5 times in total.
If OSVersion() = #PB_OS_Windows_ME : End : EndIf
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

- RemoveWindowCallback(@ProcedureName() [, #Window)
Use SetWindowCallback() with 0.
- MoveFile(SourceFileName$, DestinationFileName$)
Use RenameFile(From$, To$).
User avatar
Guimauve
Enthusiast
Enthusiast
Posts: 742
Joined: Wed Oct 22, 2003 2:51 am
Location: Canada

Post by Guimauve »

Trond wrote:
- MoveFile(SourceFileName$, DestinationFileName$)
Use RenameFile(From$, To$).
To move file use CopyFile(SourceFileName$, DestinationFileName$) then DeleteFile(SourceFileName$)

I think the MoveFile(SourceFileName$, DestinationFileName$) can Copy then delete the source file in 1 instruction instead of 2. If this command can be useful, I think not. The use of CopyFile() followed by DeleteFile() is the best way to do the job.

One cool new feature I would like to see is the Flype LinkedListEx lib as standard. (A LinkedList of LinkedList or LinkedTree if you wish)

Regards
Guimauve
User avatar
nco2k
Addict
Addict
Posts: 1344
Joined: Mon Sep 15, 2003 5:55 am

Post by nco2k »

@Trond
- RemoveWindowCallback()
whoops, i formatted my pc recently and havent updated the helpfile since then, i was wondering that there was no notice about how to remove a callback again, but never thought of using 0. :o

- MoveFile()
hm yes you are right, two commands doing basicly the same wouldnt make much sense. :)

c ya,
nco2k
If OSVersion() = #PB_OS_Windows_ME : End : EndIf
thamarok
Enthusiast
Enthusiast
Posts: 282
Joined: Wed Sep 06, 2006 1:37 pm

Post by thamarok »

Just looking at the beginning of your list, I have already made API versions of these functions:
- WindowRealWidth(#Window) ;including border, titlebar etc.
- WindowRealHeight(#Window) ;including border, titlebar etc.
- WindowClientX(#Window) ;excluding border, titlebar etc.
- WindowClientY(#Window) ;excluding border, titlebar etc.
- WindowTitleBarHeight(#Window)
- WindowBorderWidth(#Window)
- IsWindowEnabled(#Window)
- IsWindowVisible(#Window)
I'll have a look on my hardrive, if I find them I'll post them right away. :)
User avatar
nco2k
Addict
Addict
Posts: 1344
Joined: Mon Sep 15, 2003 5:55 am

Post by nco2k »

@thamarok
oh dont worry, i have api versions for that too, i have almost for everything api versions & workarounds, but it would be nice to have this native in pb because:

1.) better for beginners who hardly can handle api
2.) cross platform compatibility
3.) a more complete pb = more professional looking
4.) more professional looking = more customers :D

c ya,
nco2k
If OSVersion() = #PB_OS_Windows_ME : End : EndIf
thamarok
Enthusiast
Enthusiast
Posts: 282
Joined: Wed Sep 06, 2006 1:37 pm

Post by thamarok »

nco2k wrote:@thamarok
oh dont worry, i have api versions for that too, i have almost for everything api versions & workarounds, but it would be nice to have this native in pb because:

1.) better for beginners who hardly can handle api
2.) cross platform compatibility
3.) a more complete pb = more professional looking
4.) more professional looking = more customers :D

c ya,
nco2k
Yes, that's a good point, maybe Fred and the Team really should think about this.
venom
User
User
Posts: 56
Joined: Fri Jul 25, 2003 1:54 pm
Location: Australia

Post by venom »

Moving a file is faster than copying if the destination is on the same drive.
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

venom wrote:Moving a file is faster than copying if the destination is on the same drive.
Yes, but the function RenameFile() already moves a file.
User avatar
Joakim Christiansen
Addict
Addict
Posts: 2452
Joined: Wed Dec 22, 2004 4:12 pm
Location: Norway
Contact:

Post by Joakim Christiansen »

I agree with you very much nco2k!

And here is some of my "important" ones:

Set FontRequester style
http://www.purebasic.fr/english/viewtopic.php?t=22389

Preference files...
http://www.purebasic.fr/english/viewtopic.php?t=21803

#PB_String_Numeric - Support negative numbers.
http://www.purebasic.fr/english/viewtopic.php?t=16326

Compiler features (would be cool)
http://www.purebasic.fr/english/viewtopic.php?t=22075

ClipSprite3D()
http://www.purebasic.fr/english/viewtopic.php?t=16878

ScreenWidth() and ScreenHeight()
http://www.purebasic.fr/english/viewtopic.php?t=21032

A way to know if the mousebutton was pressed or released.
http://www.purebasic.fr/english/viewtopic.php?t=15053

#PB_Editor_RTF flag for GetGadgetText()
http://www.purebasic.fr/english/viewtopic.php?t=22436

Requester positioning

http://www.purebasic.fr/english/viewtopic.php?t=22388

HelpFile - MSDN links
http://www.purebasic.fr/english/viewtopic.php?t=23270

ClearMemory() (which you also wanted)
http://www.purebasic.fr/english/viewtopic.php?t=22038
I like logic, hence I dislike humans but love computers.
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

I have thought of "auto-with" with ForEach loops and structured linked lists. I don't know what people think of this?

Code: Select all

; "Auto-with" in ForEach loops
ForEach StructuredList()
  \Member = 0
Next
Chrono Syndrome
Enthusiast
Enthusiast
Posts: 169
Joined: Thu Oct 05, 2006 6:44 am
Contact:

Post by Chrono Syndrome »

Trond wrote:I have thought of "auto-with" with ForEach loops and structured linked lists. I don't know what people think of this?

Code: Select all

; "Auto-with" in ForEach loops
ForEach StructuredList()
  \Member = 0
Next
No, no, bad idea !
Don't try to catch ze Night !
Remember: 'z' is better zen 'th' =) !
Sorry for bad english.
User avatar
Guimauve
Enthusiast
Enthusiast
Posts: 742
Joined: Wed Oct 22, 2003 2:51 am
Location: Canada

Post by Guimauve »

In my point of view the With/EndWith it's the most bad thing I have seen in
any programming language. It supposed to be make the code more clear ...

This will make the code less clear and way way more difficult to read.
(I think this shit "With/EndWith" should be removed...)

So if you want to use With/EndWith please use it this way :

Code: Select all

ForEach Mylist()
   With Mylist()
      \Member = 0
   EndWith
Next
And leave the ForEach/Next and all other loop intact.
User avatar
nco2k
Addict
Addict
Posts: 1344
Joined: Mon Sep 15, 2003 5:55 am

Post by nco2k »

how about optional Width & Height parameters for DisplaySprite() like in the example by Stefan:

http://www.purebasic.fr/german/viewtopi ... 415#140415

this would be very cool, because:
- size of sprite doesnt matter (its not bound to 16x16, 32x32...)
- can be used with UseBuffer()
- can be clipped
- no 3d acceleration needed

c ya,
nco2k
If OSVersion() = #PB_OS_Windows_ME : End : EndIf
Post Reply