Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
72ca79a
Update imports
ssweber May 16, 2023
b1b1cf9
Fix how we handle sg.Text
ssweber May 16, 2023
41938b0
Subtle changes to value_changed
ssweber May 16, 2023
7a5dd1b
Rewritten search
ssweber May 16, 2023
c31f4f0
Add try-except to set_by_pk
ssweber May 16, 2023
c0115f9
Update set_current to write an event to the main loop
ssweber May 16, 2023
423febd
Removing some outdated comments
ssweber May 16, 2023
2caf2b7
Fix nan and numpy types showing in sg.Table / Add supported for gener…
ssweber May 16, 2023
8dd585e
Safeguards for closing popups.
ssweber May 16, 2023
5f2b676
Updates to casting / adding dt. datetime
ssweber May 16, 2023
7dc33b6
Add save_enabled to sg.Table headings (first column)
ssweber May 16, 2023
61a74a7
Date Datepicker, and displaying boolean as Checkboxes
ssweber May 16, 2023
19a35b6
Update checkbox_to_bool
ssweber May 16, 2023
97d2fea
Add `add_placeholder_to`
ssweber May 16, 2023
7a3d17b
Move LangFormat to be more logically placed (under LanguagePack
ssweber May 16, 2023
ca8f88a
New examples, orders & checkbox_behavior
ssweber May 16, 2023
2e1e814
Black fix
ssweber May 16, 2023
e72fced
Keep original info popup open, if user double-clicks save (for instance)
ssweber May 17, 2023
8f442a0
All sg.Windows use icon=themepack.icon
ssweber May 17, 2023
64f2566
Don't prompt_save after search
ssweber May 17, 2023
7719906
Add popup to failed search
ssweber May 17, 2023
af34216
Clean up orders.py example a bit
ssweber May 17, 2023
466d39f
Cleanup orders.py
ssweber May 17, 2023
1653309
convert: `is type(element) to isinstance()
ssweber May 17, 2023
037529e
Missed one isinstance replacement
ssweber May 17, 2023
2cd2be2
These arnt isinstance yet, they are just objects
ssweber May 17, 2023
956049b
Fix pd.Series converting int to floats, Fix get_current returning Non…
ssweber May 17, 2023
c56233b
Add basic *Required to sg.Inputs, and 🔍 Search...
ssweber May 18, 2023
7079494
Remove manual add_placeholder_to for search
ssweber May 18, 2023
004f1c8
Adds placeholder functionality to Combobox
ssweber May 18, 2023
56bc584
Remove auto-selecting 1st entry if placeholder is clicked
ssweber May 18, 2023
ff115c9
Without the widget.bind, don't need to subclass sg.Combo
ssweber May 18, 2023
c78938e
Cleaning up combobox placeholder implementation
ssweber May 18, 2023
d1d4d3d
Don't clobber types
ssweber May 18, 2023
b098a78
black fix
ssweber May 18, 2023
408562a
Modernize quick_editor
ssweber May 18, 2023
86ee1a7
small nit, makes sorting look wonky
ssweber May 18, 2023
9632c69
Add space to pk column in quickeditor so that sorting marker shows
ssweber May 18, 2023
1015458
Disable quick-editor in quick-editor sg.Combo
ssweber May 18, 2023
b9eb254
black fixes
ssweber May 18, 2023
fbe8f1f
Integrate placeholder functionality directly into subclassed input/mu…
ssweber May 19, 2023
d607429
Autocomplete for sg.Combo!
ssweber May 19, 2023
3982c15
Updated autocomplete, added into CellEdit as well
ssweber May 19, 2023
ba79681
Fixes for autocorrect and liveupdate meshing
ssweber May 19, 2023
5e42b00
Fix for Placeholder
ssweber May 19, 2023
34535d2
Re-written table_values/combobox_values
ssweber May 23, 2023
9efd236
little cleanup
ssweber May 23, 2023
13deea8
Small Fix, and Remove delay for combobox changes
ssweber May 23, 2023
f457617
Example update, row -> pk_is_virtual
ssweber May 23, 2023
e94b09e
Widgets dummy class
ssweber May 24, 2023
32692c3
Update .git-blame-ignore-revs
ssweber May 24, 2023
f679c03
Ignore case for combo autocompletion
ssweber May 24, 2023
e10c2ce
Rewritten Input placeholder
ssweber May 24, 2023
9a358e6
Commenting and added graceful handing of user calling add_placeholder…
ssweber May 24, 2023
7b6c8c4
LazyTable
ssweber May 25, 2023
d1b0326
Refactor and add alternating_row_color support to LazyTable
ssweber May 26, 2023
da3e258
small fix
ssweber May 26, 2023
16d7220
More LazyTable cleanup
ssweber May 26, 2023
0b7b74d
Cleaning up sg.table to support pypi version and github
ssweber May 27, 2023
ea9ea89
Small comment
ssweber May 27, 2023
7b93bd1
Start Work on Readme
ssweber May 28, 2023
2170303
Update README2.md
ssweber May 28, 2023
cd86f62
replaced <Control-/> with <Control-slash> for linux compatibility
PySimpleSQL May 29, 2023
dc070e1
Fix for add_placeholder missing
ssweber May 29, 2023
4541de7
fix search to start at current position, +1, and wrap back around to …
ssweber May 29, 2023
b47b125
Renaming subclassed widgets
ssweber May 30, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,8 @@ e4787f7ae96e2a6f11838dcd5591b58ab69fc55a
cb040bf0656ab6b3c019fadc6adf98c7d4ba01ea
f7addad546672815db9293f772db71c57521f8e8
fbeec4c4322b7a1f8dc4cd82ac3c10e6c313901a
# move langformat
7a3d17b934d739118fb074f0f572d1e30651117d
# moving widgets under Widgets dummy class
e94b09e4f103dfade9d6fffc095507b58c836bce

40 changes: 40 additions & 0 deletions README2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<!-- Begin section: Overview -->

<!-- TODO: create a dark-version of logo -->
<p align="center">
<picture align="center">
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/PySimpleSQL/pysimplesql/assets/57631333/4153cc7b-bfb2-445f-9aa7-cf2b6da0e786">
<source media="(prefers-color-scheme: light)" srcset="https://github.com/PySimpleSQL/pysimplesql/assets/57631333/4153cc7b-bfb2-445f-9aa7-cf2b6da0e786">
<img alt="pysimplesql logo" src="https://github.com/PySimpleSQL/pysimplesql/assets/57631333/4153cc7b-bfb2-445f-9aa7-cf2b6da0e786">
</picture>
</p>

Write data-driven desktop apps fast! Lightweight Python library supports SQLite, MySQL/MariaDB, PostgreSQL, Flatfile CSV, SQL Server and MS Access. Uses PySimpleGUI layouts.

---

![gif here](https://)

**[Features](#features)** - **[Requirements](#requirements)** - **[Installation](#installation)** - **[Quick usage](#quick-usage)**

## Features

- [**Test**](https://)
- Design user interfaces with automatic relationship handling

## Requirements

Dependencies here, along with link to sqldriver specific page

## Installation

- **Unix/macOS**: `python3 -m pip install pysimplesql`
- **Windows**: `py -m pip install pysimplesql`

## Quick usage

```
Ultra simple example here
```

See the [Usage](https://pysimplesql.github.io/pysimplesql/) section of the docs for more examples!
80 changes: 80 additions & 0 deletions examples/SQLite_examples/checkbox_behavior.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# fmt: off
import logging
import PySimpleGUI as sg

sg.change_look_and_feel("SystemDefaultForReal")
sg.set_options(font=("Roboto", 11)) # Set the font and font size for the table

import pysimplesql as ss # noqa: E402

logger = logging.getLogger(__name__)
logging.basicConfig(level=logging.DEBUG) # <=== Set the logging level here (NOTSET,DEBUG,INFO,WARNING,ERROR,CRITICAL)

sql = """
CREATE TABLE checkboxes (
id INTEGER PRIMARY KEY AUTOINCREMENT,
bool_none BOOLEAN,
bool_true BOOLEAN Default True,
bool_false BOOLEAN Default False,
int_none INTEGER,
int_true INTEGER Default 1,
int_false INTEGER Default 0,
text_none TEXT,
text_true TEXT Default "True",
text_false TEXT Default "False"
);

INSERT INTO checkboxes (bool_none, bool_true, bool_false, int_none, int_true, int_false, text_none, text_true, text_false)
VALUES (NULL,True,False,NULL,1,0,NULL,"True","False");
"""

# -------------------------
# CREATE PYSIMPLEGUI LAYOUT
# -------------------------
# Create a table heading object
headings = ss.TableHeadings(sort_enable=True, edit_enable=True)

# Add columns to the table heading
headings.add_column('id', 'id', width=5)

columns = ['bool_none', 'bool_true', 'bool_false', 'int_none', 'int_true', 'int_false', 'text_none', 'text_true', 'text_false']

for col in columns:
headings.add_column(col, col, width=8)

fields = []
for col in columns:
fields.append([ss.field(f'checkboxes.{col}', sg.Checkbox, size=(20, 10), label={col})])

layout = [
[sg.Text('This test shows pysimplesql checkbox behavior.')],
[sg.Text('Each column is labeled as type: bool=BOOLEAN, int=INTEGER, text=TEXT')],
[sg.Text("And the DEFAULT set for new records, no default set, True,1,'True', or False,0,'False'")],
[ss.selector('checkboxes', sg.Table, num_rows=10, headings=headings, row_height=25)],
[ss.actions('checkboxes', edit_protect=False)],
fields,
]

win = sg.Window('Checkbox Test', layout, finalize=True)
driver = ss.Driver.sqlite(":memory:", sql_commands=sql)
# Here is the magic!
frm = ss.Form(
driver,
bind_window=win,
live_update=True # this updates the `Selector`, sg.Table as we type in fields!
)

# ---------
# MAIN LOOP
# ---------
while True:
event, values = win.read()

if event == sg.WIN_CLOSED or event == 'Exit':
frm.close() # <= ensures proper closing of the sqlite database and runs a database optimization
win.close()
break
elif ss.process_events(event, values): # <=== let PySimpleSQL process its own events! Simple!
logger.info(f'PySimpleDB event handler handled the event {event}!')
else:
logger.info(f'This event ({event}) is not yet handled.')
Loading